android ancestor navigation

Solutions on MaxInterview for android ancestor navigation by the best coders in the world

showing results for - "android ancestor navigation"
Matisse
14 Nov 2017
1@Override
2public boolean onOptionsItemSelected(@NonNull MenuItem item) {
3  int itemId = item.getItemId();
4  if (itemId == android.R.id.home) {
5    // force up navigation to have the same behavior as temporal navigation
6    onBackPressed();
7    return true;
8  } else {
9    return super.onOptionsItemSelected(item);
10  }
11}