3

I'm creating and ACTION_VIEW intent with a URI like https://www.example.com/somedirection.

There's an app, lets call it the EXAMPLEAPP than can open that intent, but if you do not have that app in your phone. Then you can open the URI in any browser.

The thing is that I don't want the user to use the EXAMPLEAPP to follow that intent because I'm having some problems when the user returns to my app (they have to make a payment in that intent).

So, if the user doesn't have the app, no problem, everything good. But if the user have the EXAMPLEAPP the intent chooser only shows that app, it doesn't show any browser, but, as I said, I don't want the user to complete the intent with that app.

Why is the chooser not showing any browser (I have Chrome installed) and only the app when the app is installed?

This is my code.

Intent intent = new Intent(Intent.ACTION_VIEW);
intent.setData(Uri.parse(electronicLink));
Intent chooser = Intent.createChooser(intent, "Some title");
if (intent.resolveActivity(packageManager) != null) {
    context.startActivity(chooser);
}

I have also tried to call

List<ResolveInfo> list = packageManager.queryIntentActivities(intent, 0);

And I'm only seeing the app when it's installed and Chrome when it's not.

Gustavo Conde
  • 787
  • 11
  • 19
  • Were you able to solve this issue? I am having a similar issue, http://stackoverflow.com/questions/42826332/intent-createchooser-for-action-view-shows-default-browser-only – sissyphus_69 Mar 16 '17 at 06:12
  • 1
    No. Something has been changed from Android 5 to Android 6. In a phone with Android 5 I have the browser option besides the app option. In a phone with Android 6 I can only open the link with the app. – Gustavo Conde Mar 16 '17 at 13:58
  • I am on API 23. I am also having the same problem. Previously, Chrome, Google pdf viewer and ES Downloader was shown in my app list but now ES Downloader and Google pdf viewer are displayed although chrome, opera mini are also installed. @GustavoConde have you solved this? – Sagar Chapagain Jul 04 '17 at 09:51
  • I found the solution. The problem was in OS. I am using Samsung J5. All the applications were shown after Resetting app preferences from Settings->App Manager. – Sagar Chapagain Jul 04 '17 at 11:27

0 Answers0