android - 通过我的应用分享

标签 android android-intent

我正在制作一个状态共享应用程序,用户通过我的应用程序共享图像和短信,现在我希望它在从 facebook 或 google+ 共享图像或文本时出现在列表中 enter image description here

最佳答案

将此添加到您的 list 文件中

    <activity
    android:name="Activity"
    android:icon="@drawable/ic_launcher"
    android:label="test">
    <intent-filter>
        <action android:name="android.intent.action.MAIN" />

        <category android:name="android.intent.category.LAUNCHER" />
    </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" />

        <category android:name="android.intent.category.DEFAULT" />

        <data android:mimeType="text/plain" />
    </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>

关于android - 通过我的应用分享,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38140912/

相关文章:

android - 使背景覆盖所有屏幕尺寸

Android:在选项卡内传输字符串/值,每个选项卡都有自己的 Activity (Getters-Setter 除外)

java - 拍照失败 java.lang.runtimeexception 无法以 Intent 启动服务

android - 从调用返回时 ViewRootImpl 中的 NullPointerException(仅适用于 Samsung Touch)

java - 如何访问 AccountManager.newChooseAccountIntent 返回的 bundle ?

Android:检查用户设备上是否存在 Facebook 应用程序

Android FirebaseUI : Showing a button even when only one provider is chosen

java - 设备上没有剩余空间 - Android 模拟器

Android 在自定义文件夹中保存相机图像

android - 在 Android 的 ViewPager 中将子 fragment 添加到父 fragment