Broadcast Receiver ACTION_SEND does not show up

烂漫一生 提交于 2019-12-11 02:54:57

问题


i want to use a broadcast receiver for "implicit intents" who use the type ACTION_SEND.

It's still very basic but anyway my app/receiver already does not show up, no matter which app's "share menu" i try.

excerpt from AndroidManifest.xml:

        <receiver
        android:name=".SaveReceiver" >
        <intent-filter
            android:icon="@drawable/ic_launcher"
            android:label="YourDrive" >
            <action android:name="android.intent.action.SEND" />
            <category android:name="android.intent.category.DEFAULT" />

        </intent-filter>
        <intent-filter
            android:icon="@drawable/ic_launcher"
            android:label="YourDrive" >
            <action android:name="android.intent.action.SEND_MULTIPLE" />
        </intent-filter>
    </receiver>

I've tried setting a mimeType, but nothing helps. Do I have to set a specific mimeType or can i just check it later on (via Java code when handling the content)? What am I doing wrong, so that my app doesn't show up in "Share menus" of all apps...

Thanks in advance.


回答1:


i want to use a broadcast receiver for "implicit intents" who use the type ACTION_SEND.

ACTION_SEND is an activity action, not a broadcast action. You cannot pick up startActivity() calls with a BroadcastReceiver.

What am I doing wrong, so that my app doesn't show up in "Share menus" of all apps...

You are not implementing an activity.

http://developer.android.com/training/sharing/receive.html



来源:https://stackoverflow.com/questions/12901763/broadcast-receiver-action-send-does-not-show-up

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!