android - menu is not shown unless group activity is focussed -


The menu option is not visible on BTN click, unless it is the focus.

  @Orride Creative Options menu on the Public Boolean (menu menu) {// TODO auto generated method stub System.out.println ("in the menu"); New MenuInflater (This. GatePant ()) Flight (R. menu Sample, Menu); Return (super.onCreateOptionsMenu (menu)); }    

Try reading this blog post.

If the menu is not in the activities of your activity group, to call only the relevant method of your current sub-activity, override the On-Cereoopts menu and Opportunity selected methods in your activity group.

Here's what you want to add to your Activity Group class:

  @ Override public boolean on crat option menu (menu menu) {this return.getCurrentActivity (). OnCreateOptionsMenu (menu); } @ Override Public Boolean On Option Itam Select (menu item) {come back here. Contract Activity () On Options Item Selected (Item); }   

That's it. Now apply these methods to each sub-activity of your choice and it should work properly.

Comments