Home > DeveloperSection > Forums > How can I open a URL in Android's web browser from my application?
Chintoo Semi

Total Post:135

Posted on    June-08-2015 7:21 AM

 Android Android 

 1 Reply(s)
 415  View(s)
Rate this:
How can I get crash data (stack traces at least) from my Android application? At least when working on my own device being retrieved by cable, but ideally from any instance of my application running on the wild so that I can improve it and make it more solid.

Mayank Tripathi
Mayank Tripathi

Total Post:397

Posted on    June-08-2015 7:51 AM

Try this:

Intent browserIntent = new Intent(Intent.ACTION_VIEW, Uri.parse("http://www.google.com"));
That works fine for me.

As for the missing "http://" I'd just do something like this:

if (!url.startsWith("http://") && !url.startsWith("https://"))
   url = "http://" + url;
I would also probably pre-populate your EditText that the user is typing a URL in with "http://".

Don't want to miss updates? Please click the below button!

Follow MindStick