Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to open default browser

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

like image 765
apatki Avatar asked Feb 22 '11 08:02

apatki


2 Answers

You have to import intent.

String url = "http://www.google.com";
Intent browserIntent = new Intent(Intent.ACTION_VIEW, Uri.parse(url));
startActivity(browserIntent);
like image 186
Anas Khan Avatar answered Nov 15 '22 22:11

Anas Khan


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"));
like image 44
Valentin Rocher Avatar answered Nov 15 '22 21:11

Valentin Rocher