Android Intent Filter - JamesDansie/data-structures-and-algorithms GitHub Wiki

Intent Filter

Author: James Dansie

How to get your app to show up on the "share" list.

  1. Add <intent-filter> to your AndroidManifest.xml.
<activity android:name="ReplaceWithTheNameOfYourActivityYouWantToStart">
    <intent-filter>
        <action android:name="android.intent.action.SEND"/>
        <category android:name="android.intent.category.DEFAULT"/>
        <data android:mimeType="text/plain"/>
        <data android:mimeType="image/*"/>
    </intent-filter>
</activity>
  1. Check for if(Intent.ACTION_SEND.equals(getIntent().getAction)) {do stuff}

References

  1. https://developer.android.com/training/basics/intents/filters
⚠️ **GitHub.com Fallback** ⚠️