Sending an Intent to browser to open specific URL [duplicate] Sending an Intent to browser to open specific URL [duplicate] android android

Sending an Intent to browser to open specific URL [duplicate]


To open a URL/website you do the following:

String url = "http://www.example.com";Intent i = new Intent(Intent.ACTION_VIEW);i.setData(Uri.parse(url));startActivity(i);

Here's the documentation of Intent.ACTION_VIEW.


Source: Opening a URL in Android's web browser from within application


The short version

startActivity(new Intent(Intent.ACTION_VIEW,     Uri.parse("http://almondmendoza.com/android-applications/")));

should work as well...


The shortest version.

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