Skip to content

Instantly share code, notes, and snippets.

@agusibrahim
Created July 3, 2017 04:04
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 agusibrahim/b98821df84ee26265c3dbdcd9f91bcf0 to your computer and use it in GitHub Desktop.
Save agusibrahim/b98821df84ee26265c3dbdcd9f91bcf0 to your computer and use it in GitHub Desktop.
Test Post with java Android
public boolean onOptionsItemSelected(MenuItem item) {
switch (item.getItemId()) {
case R.id.menu_login:
String token=gauth.getAccessToken();
if(token==null) doLogin();
else mPerformEdit.setDefaultText("Has Login, Token: "+token);
break;
case R.id.menu_settings:
if(gauth.getAccessToken()!=null){
doPost();
}
break;
}
return super.onOptionsItemSelected(item);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment