android - Android 中的 ACTION_SEND 和 Google+ 应用

标签 android android-intent google-plus

有什么方法可以通过使用 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/

相关文章:

android - 如何获取 View 的大小?

android sqlite 外键不工作

android - 在 TabActivity 的单个选项卡中重新启动 Activity ?

android - 带有表格布局的 ListView

c# - 如何在 c# MVC 中从 Google+ 登录迁移到 Google 登录

android - setcontentview() 不适用于 Activity

Android 在 NFC 标签上多次启动 Activity

java - 无法从切换按钮到第二个 Activity 获取值

access-token - Google plus 的 access_token 集成

android - 使用 google plus 登录