Launching a specific browser by icon is done with a ACTION_MAIN. Launching a specific url using default browser is done with a ACTION_VIEW.
What if you want to open a specific url in a specific browser?
If you know the package name and the class name of the browser,you can use Intent.setClassName (String packageName, String className). looks like:
Intent i=new Intent(ACTION_VIEW, url);
i.setClassName("com.test.browser","BrowserActivity");
startActivity(i);
You can even call the specific browser via its package name.
Like this;
Intent intent = new Intent(Intent.ACTION_VIEW,Uri.parse("https://www.google.co.com"));
intent.setPackage("org.mozilla.firefox");
startActivity(intent);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With