Sash_KP Sash_KP - 1 year ago 64
Android Question

Android - "Open with" dialog still displays even after choosing an option from Intent.createChooser

I have an

by clicking on which i need to open chooser which will show multiple apps which are eligible to open urls.I am doing something like this :

Intent intent = new Intent();
} else {
startActivity(Intent.createChooser(intent, "Open Url Using"));

This works fine and open up the chooser. But among all the apps , if i choose "default browser" app of the device, then it again asks for "Open with" dialog. However if i choose other apps like chrome or firefox then it works fine and no 2nd open with dialog is shown.

So apart from default browser app, for other browser apps it works fine.

Question: Is there any known issue as such that even after using
, for default browser, another "open with" dialog will open to ask again which app to use? If yes how to get rid of that?

Note: This doesn't happen in every device. For some devices this works fine but for other devices it asks for open with dialog again even after choosing an option from

Answer Source

The problem here seems to have been with the particular browsers themselves, not necessarily with your Intent chooser. When being redirected to the mobile site, basic browsers often will just handle this as a new request, and may show an Intent chooser of their own.

A workaround for this is to pass the mobile site URL explicitly, if possible, which would eliminate the need for the redirect, and open the site directly in the chosen browser.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download