Android launches specific URL with specific browser

A specific browser is launched using the icon using ACTION_MAIN. Starting a specific URL using a default browser is done using ACTION_VIEW.

What if you want to open a specific URL in a specific browser?

+3
source share
3 answers

If you know the package name and browser class name, you can use Intent.setClassName (String packageName, String className). as follows:

Intent i=new Intent(ACTION_VIEW, url);
i.setClassName("com.test.browser","BrowserActivity");
startActivity(i);
+7
source

You can even call a specific browser through 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);
+1
source

, . . , .

Android, ...

0
source

All Articles