Created
April 23, 2014 19:04
-
-
Save kristopherjohnson/11228383 to your computer and use it in GitHub Desktop.
Treat Android action-bar Home button as "Back"
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@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