Skip to content

Instantly share code, notes, and snippets.

Minas Mina minas1

  • Cyprus
View GitHub Profile
@minas1
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.
You can’t perform that action at this time.