Showing posts with label open URL. Show all posts
Showing posts with label open URL. Show all posts

Tuesday, October 29, 2013

onClick open browser with given URL



onClick open browser with given URL

Output :

// on click its open in browser with url = http://www.google.com


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

intent.setComponent(new ComponentName("com.android.browser",
"com.android.browser.BrowserActivity"));

intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);

getApplicationContext().startActivity(intent);