I would like to share a URI from my app, and have the app chooser dialog show options for ACTION_SEND apps (like SMS and copy to clipboard) as well as ACTION_VIEW apps (like Chrome). So far, I can only seem to get one set of apps to show at a time. Is there a way to combine intent actions?
Here is what plain ACTION_SEND intent looks like:
Intent i = new Intent();
i.setAction(Intent.ACTION_SEND);
i.setType("text/plain");
i.putExtra(Intent.EXTRA_TEXT, "www.example.com");
context.startActivity(Intent.createChooser(i, "Share"));
This results in the normal chooser for apps that send information. But no open in browser options.
Here is what ACTION_VIEW intent looks like:
Intent i = new Intent();
i.setAction(Intent.ACTION_VIEW);
i.putData(Uri.parse("www.example.com"))
context.startActivity(Intent.createChooser(i, "Share"));
This results in the normal chooser for opening the link in the browser. But no options for info sending apps.
Is there a way to "combine" these two behaviors so both sets of options show up in the chooser dialog?
I have also tried to add categories to the intent, but no luck.
EDIT: I stumbled across this question where the OP has the same issue. However, I would like a solution that does not involve creating a bunch of custom activities for each app I'd like to show in the chooser.