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}