android - How to make different menu options in different Fragment? -
I have to put a separate menu option separately in section adhered to. But my piece is adding to menu activity menu. But I do not want to have an activity menu in some of my pieces.
Sliding Drever Activity :
@ Override Public Boolean On Crate Option Menu (menu menu) {getMenuInflater (). Flood (R.MenuMenuMmen, Menu); Back true; } In my piece:
public friends_stateus_mant_fragment () {setHasOptionsMenu (true); } @CreateOptions Override public zeros on menu (menu menu, menu infletter inflator) {inflater.inflate (R.menu.menu_add_comment, menu); Super.onCreateOptionsMenu (menu, inflater); } Activity items are added with pieces of pieces. How to turn it off ???
I'm not sure that I'm weakening your problem - clearing you menus in your pieces Should have to be new - and do not call super - something like this:
@CreateOptions Override public zeros on menu (menu menus, menu inflator inflator) {menu.clear ( ); Inflater.inflate (R.menu.menu_add_comment, menu); }
Comments
Post a Comment