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.
精彩评论