0

Here is part of my code:

Intent sendIntent = new Intent(Intent.ACTION_VIEW, URI.parse("https://stackoverflow.com/");

Intent chooser = Intent.createChooser(sendIntent, "Open the link in: ");

startActivity(chooser);

Some extra information:

  1. I have multiple browsers installed like Chrome, Firefox and others.
  2. I tried clearing the Chrome defaults, cache and other application data by going to Settings > App Manager.

Other similar questions like:

Show browser list when opening a link in android shows the code that I am using as solution.

Action_view intent not showing browser options in chooser or don't have an accepted answer.

Real Noob
  • 1,369
  • 2
  • 15
  • 29
  • check this out https://stackoverflow.com/a/28492633/12709358 – Elango Jul 28 '22 at 16:26
  • Thanks @AjithkumarMuthukumaran but that solution doesn't help me. I have tried the same code and it doesn't show me the option to choose a browser. – Real Noob Jul 29 '22 at 04:57
  • I have tried with your code its working perfectly! Did you tried with `````` ? – Elango Jul 29 '22 at 05:44
  • @AjithkumarMuthukumaran How do I add intent filter? I have never done Android programing before. Also, did it work for you without the intent filter? – Real Noob Jul 29 '22 at 06:14
  • 1
    Yes working on my emulator. check this out https://stackoverflow.com/a/33599836/12709358 – Elango Jul 29 '22 at 06:25
  • Thanks @AjithkumarMuthukumaran This helped me understand a few things. My smartphone has multiple browsers but it has set Chrome to default. I can change the default browser to something else. However, there is no option to remove all default browsers. – Real Noob Jul 29 '22 at 06:51
  • The other answer said that `createChooser()` will always show a list of browsers even if default browser is set. Is this behavior vendor specific? – Real Noob Jul 29 '22 at 06:52
  • May I know your device brand and android version? – Elango Jul 29 '22 at 12:41

0 Answers0