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
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
You have to import intent.
String url = "http://www.google.com";
Intent browserIntent = new Intent(Intent.ACTION_VIEW, Uri.parse(url));
startActivity(browserIntent);
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"));
Intent i = new Intent(Intent.ACTION_VIEW,Uri.parse(value));
startActivity(i);
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"));
startActivity(blankIntent);
Tested with:
Stock Browser, Chrome, Firefox and Opera for Android