Android browser intent open Dlophin instead of Firefox

440 Views Asked by At

I've googled few hours but couldn't find how to change my intent from Firefox to dolphin browser. I know how to get the list of browsers, but I'm looking in specific to open only the Dolphin web browser, later I will deal with exception if not installed.

    String url = "http://www.google.com";
    Intent intent = new Intent(Intent.ACTION_MAIN, null);
    intent.addCategory(Intent.CATEGORY_LAUNCHER);
    intent.setComponent(new ComponentName("org.mozilla.firefox", "org.mozilla.firefox.App"));
    intent.setAction("org.mozilla.gecko.BOOKMARK");
    intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
    intent.putExtra("args", "--url=" + url);
    intent.setData(Uri.parse(url));
    startActivity(intent);
1

There are 1 best solutions below

2
On

You could decompile the apk you are aiming for (Dolphin) to understand what they put in their manifest to open the url and target exactly that apk..

.. but limiting your users will break really easily if they don't have that specific browser installed. The opposite way, if you want your users to always be able to open your url, is to them choose:

startActivity(Intent.createChooser(intent), "Title of my intent chooser");