Skip to content

Commit

Permalink
added onBackPressed method
Browse files Browse the repository at this point in the history
  • Loading branch information
doneill committed Jul 18, 2014
1 parent 99caddd commit f604226
Showing 1 changed file with 14 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,20 @@ public boolean onOptionsItemSelected(MenuItem item) {
return super.onOptionsItemSelected(item);
}

@Override
public void onBackPressed() {
getActionBar().setHomeButtonEnabled(false);
getActionBar().setDisplayHomeAsUpEnabled(false);

if (mOnlyTheMapIsDisplayed) {
// Single-pane mode and map fragment displayed - Back returns us to list fragment
displayListFragment();
} else {
// Otherwise Back finishes the activity
finish();
}
}

/**
* Displays the list fragment.
*/
Expand Down

0 comments on commit f604226

Please sign in to comment.