Home » Android » android – How to open default browser

android – How to open default browser

Posted by: admin May 14, 2020 Leave a comment


Can we make use of default browser instead of the WebView browser
Is there ny API for the default browser…..

or we have to compulsory create our own browser through WebView

How to&Answers:

You can use an Intent with ACTION_VIEW to open the browser with your URL. Would be something like that :

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


You have to import intent.

String url = "http://www.google.com";
Intent browserIntent = new Intent(Intent.ACTION_VIEW, Uri.parse(url));


Intent i = new Intent(Intent.ACTION_VIEW,Uri.parse(value));

value is your URL address.


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

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

Tested with:

Stock Browser, Chrome, Firefox and Opera for Android