I have an activity that has 2 fragments.
1 fragment is displayed simultaneously, and each fragment has a different options menu.
I can achieve this behavior in two different ways.
1 - I can add another menu for each fragment by calling onCreateOptionsMenu in each of them. 2 - I can have only one menu at the activity level and you can choose to show a specific option in onPrepareOptionsMenu
What I want to know:
What is the preferred way to implement this functionality? What is recommended?
android android-fragments menu
Sair
source share