mirror of
https://github.com/TeamNewPipe/NewPipe.git
synced 2025-10-03 09:49:21 +02:00
Use fragments setHasOptionsMenu
Remove complications by allowing android to handle fragment's options menu. See https://developer.android.com/guide/components/fragments.html#ActionBar
This commit is contained in:
parent
7efd111d9c
commit
8e451b2a83
5 changed files with 6 additions and 16 deletions
|
@ -52,8 +52,6 @@ public class MainActivity extends AppCompatActivity {
|
|||
MenuInflater inflater = getMenuInflater();
|
||||
|
||||
inflater.inflate(R.menu.main_menu, menu);
|
||||
|
||||
mainFragment.onCreateOptionsMenu(menu, inflater);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -79,8 +77,7 @@ public class MainActivity extends AppCompatActivity {
|
|||
return true;
|
||||
}
|
||||
default:
|
||||
return mainFragment.onOptionsItemSelected(item) ||
|
||||
super.onOptionsItemSelected(item);
|
||||
return super.onOptionsItemSelected(item);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue