Intent filter for launcher and send activity

前端 未结 1 1381
北海茫月
北海茫月 2021-01-02 05:15

I\'m trying to get my main activity to be the launcher activity and also receive send events. Somehow I can\'t seem to make both work same time. Either I have the launcher i

相关标签:
1条回答
  • 2021-01-02 05:43

    I found the solution. You can actually have more than one intent-filter tag in an action. So the right code was

            <intent-filter>
                <category android:name="android.intent.category.LAUNCHER"/>
                <action android:name="android.intent.action.MAIN"/>
            </intent-filter>
            <intent-filter>
                <action android:name="android.intent.action.SEND"/>
                <data android:mimeType="image/*"/>
            </intent-filter>
    
    0 讨论(0)
提交回复
热议问题