Skip to content

Instantly share code, notes, and snippets.

@hndr91
Created October 3, 2015 10:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hndr91/cdf3561661ab37d55351 to your computer and use it in GitHub Desktop.
Save hndr91/cdf3561661ab37d55351 to your computer and use it in GitHub Desktop.
Simple Android WebView - onOptionItemSelected
@Override
public boolean onCreateOptionsMenu(Menu menu) {
getMenuInflater().inflate(R.menu.menu_main, menu);
return true;
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
int id = item.getItemId();
if (id == R.id.action_exit) {
//close app when click Close setting menu
finishApp();
return true;
}
return super.onOptionsItemSelected(item);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment