How to tell which app was selected by Intent.createChooser?

前端 未结 5 877
囚心锁ツ
囚心锁ツ 2020-11-29 05:26

Code:

Intent launchIntent = new Intent(Intent.ACTION_MAIN);
launchIntent.addCategory(Intent.CATEGORY_HOME);
Intent chooser = Intent.createChooser(launchInten         


        
5条回答
  •  眼角桃花
    2020-11-29 05:37

    On Android 5.1+, you can use the three-parameter edition of the createChooser() method, where the last parameter is an IntentSender that you can use to find out what was chosen.

    Prior to Android 5.1, there is nothing in Android to let you know what the user chose.

提交回复
热议问题