Broadcast Receiver ACTION_SEND does not show up

2019-07-10 08:24发布

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条回答
Root(大扎)
2楼-- · 2019-07-10 09:12

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

查看更多
登录 后发表回答