How to open the default browser

Can I use the default browser instead of the WebView browser Is there an API for the default browser .....

or we need to force to create our own browser through WebView

+6
android browser
source share
4 answers

You can use the intent with ACTION_VIEW to open a browser with your URL. It would be like this:

 Intent i = new Intent(Intent.ACTION_VIEW, Uri.parse("http://www.example.com")); 
+11
source share

You need to import the intent.

 String url = "http://www.google.com"; Intent browserIntent = new Intent(Intent.ACTION_VIEW, Uri.parse(url)); startActivity(browserIntent); 
+8
source share
 Intent i = new Intent(Intent.ACTION_VIEW,Uri.parse(value)); startActivity(i); 

value is your url.

+3
source share

This is a late answer, but if you just need to open the default browser without a URL, you can use about:blank , i.e.:

 Intent blankIntent = new Intent(Intent.ACTION_VIEW, Uri.parse("about:blank")); startActivity(blankIntent); 

Tested with

Stock Browser, Chrome, Firefox and Opera for Android

0
source share

All Articles