Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
FilterIntentChooser
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
You can’t perform that action at this time.