Skip to content

Instantly share code, notes, and snippets.

@kristopherjohnson
Created April 23, 2014 19:04
Show Gist options
  • Save kristopherjohnson/11228383 to your computer and use it in GitHub Desktop.
Save kristopherjohnson/11228383 to your computer and use it in GitHub Desktop.
Treat Android action-bar Home button as "Back"
@Override
public boolean onOptionsItemSelected(final MenuItem item)
{
final int itemId = item.getItemId();
switch (itemId)
{
case android.R.id.home:
// Action bar home button: go back
finish();
return true;
}
return super.onOptionsItemSelected(item);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment