Skip to content

Instantly share code, notes, and snippets.

@warpdesign
Created May 15, 2014 18:08
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 warpdesign/0bd0c84da48d59ba8d04 to your computer and use it in GitHub Desktop.
Save warpdesign/0bd0c84da48d59ba8d04 to your computer and use it in GitHub Desktop.
@Override
public boolean onOptionsItemSelected(MenuItem item) {
// Handle action bar item clicks here. The action bar will
// automatically handle clicks on the Home/Up button, so long
// as you specify a parent activity in AndroidManifest.xml.
int id = item.getItemId();
switch(id) {
// ...
// up button
case android.R.id.home:
finish();
overridePendingTransition(R.anim.activity_back_in, R.anim.activity_back_out);
return true;
}
return super.onOptionsItemSelected(item);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment