In onOptionsItemSelected... I saw some code that are different in the switch block.
Case 1 (Normally seen)
public boolean onOptionsI
I just had the problem that my
getActionBar().setDisplayHomeAsUpEnabled(true);
was not working. When touching the back button it would be highlighted but nothing happened.
It took me a while to figure out that this was the return of true.
In my opinion the best solution with less code duplication would be the following:
public boolean onOptionsItemSelected(MenuItem item) {
switch (item.getItemId()) {
case MENU_NEW_GAME:
newGame();
break;
default:
return false;
}
return true;
}