How can I code my Android application to start the web browser to display a given URL?
(I'd rather not embed a web browser component into my app, but rather want to start the Android web browser to show the URL.)
Thanks!
Just use an Intent with the correct action and data:
Intent intent = new Intent(Intent.ACTION_VIEW);
intent.setData(Uri.parse("http://www.stackoverflow.com"));
startActivity(intent);
In case if you have the website displayed on your view and you want it to make it clikable and direct user to particular website You can use:
android:autoLink="web"
In same way you can use different attributes of autoLink(email, phone, map, all) to accomplish your task...
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With