有什么方法可以通过使用 ACTION_SEND 和 google+ 应用程序从我的 Android 应用程序共享文本。
有没有人试过,我应该写哪种 mimeType?
感谢您的回答
最佳答案
我很确定 Google+ 应用程序具有文本/纯文本和图像/* 的 Intent 过滤器。这是他们在 list 中的内容:
<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>
因此,您应该能够将 Extra 字符串添加到您的 Intent 和 setType("text/plain") 中,这很可能会正常工作。不过,您似乎无法同时发送文本和图片,因为 G+ 上的 SEND_MULTIPLE 仅拍摄图片。
关于android - Android 中的 ACTION_SEND 和 Google+ 应用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7599923/