Created
October 14, 2015 06:53
-
-
Save kyze8439690/45835708ea1a1fb275f8 to your computer and use it in GitHub Desktop.
FilterIntentChooser
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Intent[] targetedShareIntents = new Intent[infos.size()]; | |
for (int i = 0; i < infos.size(); i++) { | |
String packageName = infos.get(i).activityInfo.packageName; | |
Intent targetedShareIntent = new Intent(Intent.ACTION_VIEW, uri); | |
targetedShareIntent.setPackage(packageName); | |
targetedShareIntents[i] = targetedShareIntent; | |
} | |
Intent chooserIntent = Intent.createChooser(new Intent(), "打开网页"); | |
chooserIntent.putExtra(Intent.EXTRA_INITIAL_INTENTS, targetedShareIntents); | |
activity.startActivity(chooserIntent); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment