sri404 / mobyfactory-uiwidgets-android

Automatically exported from code.google.com/p/mobyfactory-uiwidgets-android
0 stars 0 forks source link

How to get different options menu for each tab? #2

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Since all tabs run within the main activity - how can I create different 
options menus for each of the tab activities?

If I implement onCreateOptionsMenu etc within my tab activity, it is ignored.  
Instead I must place this code within my main activity (tab controller) but 
that means I get the same options menu no matter which tab is in focus.

Any idea how I can get around this?

Original issue reported on code.google.com by d.w.flan...@googlemail.com on 22 Apr 2010 at 3:46

GoogleCodeExporter commented 9 years ago
Hello,
I could implement the behavior that you describe above.
Basically you use the onCreateOptionsMenu on the tab controller : in the 
implementation you just call 
menu.clear();
getCurrentActivity.onCreateOptionsmenu()...
and on each of your activities of each tab you do us usual ...
Hope this helps

Original comment by achraf.t...@gmail.com on 27 Jul 2010 at 8:15