开发者

ACTION_SEND and Google+ App in Android

is there any way to share text from my android app by using ACTION_SEND开发者_运维问答 and google+ app.

Has anyone try that, which mimeType should i write?

Thanks for your answers


I am pretty sure that Google+ app has intent filters for text/plain and image/*. Here's what they have in the manifest:

    <activity android:theme="@style/CircleBrowserTheme" android:name=".phone.PostActivity" android:launchMode="singleTop" android:logo="@drawable/ic_menu_stream">
        <intent-filter>
            <action android:name="android.intent.action.SEND" />
            <category android:name="android.intent.category.DEFAULT" />
            <data android:mimeType="text/plain" />
        </intent-filter>
        <intent-filter>
            <action android:name="android.intent.action.SEND" />
            <category android:name="android.intent.category.DEFAULT" />
            <data android:mimeType="image/*" />
        </intent-filter>
        <intent-filter>
            <action android:name="android.intent.action.SEND_MULTIPLE" />
            <category android:name="android.intent.category.DEFAULT" />
            <data android:mimeType="image/*" />
        </intent-filter>
    </activity>

So you should be able to putExtra a String onto your intent and setType("text/plain") and that will most likely work just fine. Looks like you won't be able to send both a text and a picture at the same time, though, as SEND_MULTIPLE on G+ only takes images.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜