Launch Android Browser

I need directions on how to launch the Android browser through code. Thanks!

+4
source share
2 answers

If you want a fully exploded browser try:

startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse("http://Yoururl.com"))); 

See ACTION_VIEW Intention.

If you want to just display some HTML request, use WebView :

 WebView webview = new WebView(this); setContentView(webview); webview.loadUrl("http://yoururl.org/"); 
+7
source

I do not quite understand what you mean. But from what I see, you need to either WebView or use Intent to use the browser itself.

Check out the Intent documentation. There's also a blog post that gives you 4 ways to open a webpage in Android. I assume that the commonly used method will use Intent.ACTION_VIEW

 Uri uri = Uri.parse( "http://stackoverflow.com" ); startActivity(new Intent(Intent.ACTION_VIEW, uri)); 

Here 's a blog post explaining this

+5
source

Source: https://habr.com/ru/post/1307005/


All Articles