I’m using ViewPagerIndicator to show different pages in a single activity. Is it possible to have a different menu displayed by pressing the menu button on each different page? For example, Page 1 would show “Add” and “Delete” menu items while Page 2 would have “Edit” and “Settings”? These are stupid examples but it the menu seems to be created when the activity is instantiated so when I hit the MENU button the menu has already been created so I get the same menu items no matter which page is currently showing. Is it possible to trigger the onCreateOptionsMenu() when changing the page in ViewPagerIndicator?
I’m using ViewPagerIndicator to show different pages in a single activity. Is it possible
Share
You need to Use Below Method in
ActivityOverride this onPrepareOptionsMenu(Menu menu)
in this Method you can device which menu you want to display when user Press Menu button in android.as You have Used ViewPagerIndicator ,You known which Page is display and according to that you can make your
switchcondition orif and else if.