简体   繁体   中英

Android detect which app handles intent

In my application, I use an intent to open a browser. Is there any way I can find out which application the user uses to handle the intent? (A popup window appears when startActivity(intent) is called, and the user chooses which browser, or application, to use to handle the intent.

Is there any way I can find out which application the user uses to handle the intent?

Prior to Android 5.2, no, other than by implementing your own chooser UI using PackageManager and queryIntentActivities() .

There is a new version of createChooser() in API Level 22 that will notify you of what the user chose, by means of an IntentSender created from a PendingIntent .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM