Skip to content

Instantly share code, notes, and snippets.

minas1 / gist:f920c037e511f71a1d06c9261f3307be
Created Nov 9, 2018
Exclude your own Activity from Activity.startActivity(Intent) chooser
View gist:f920c037e511f71a1d06c9261f3307be
* Attempts to start an activity to handle the given intent, excluding activities of this app.
* <ul>
* <li>If the user has set a default activity (which does not belong in this app's package), it is opened without prompt.</li>
* <li>Otherwise, an intent chooser is displayed that excludes activities of this app's package.</li>
* </ul>
* @param context context
* @param intent intent to open
* @param chooserTitle the title that will be displayed for the intent chooser in case one needs to be displayed.