Skip to content

Instantly share code, notes, and snippets.

@jesselima
Created July 17, 2018 16:58
Show Gist options
  • Select an option

  • Save jesselima/951f25c15ba2952b67b7ed88620e81e7 to your computer and use it in GitHub Desktop.

Select an option

Save jesselima/951f25c15ba2952b67b7ed88620e81e7 to your computer and use it in GitHub Desktop.
Android Network Code Snipets
/**
* When a item list is clicked the news item will be shown on the device browser.
*
* @param url is Web Url of the news item.
*/
private void openWebPage(String url) {
Uri uriWebPage = Uri.parse(url);
Intent intent = new Intent(Intent.ACTION_VIEW, uriWebPage);
if (intent.resolveActivity(getPackageManager()) != null) {
startActivity(intent);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment