How to set common option menu across various tabs in android? -


**hii new android developement...i created app 3 tabs , added activity in each tabs , there menu 3 options...but when added activity each tabs common option menu not working...i mean displaying menu whenever click of menu options doesn't show output.

@override public boolean oncreateoptionsmenu(menu menu) {     // todo auto-generated method stub     menuinflater inflater=getmenuinflater();     inflater.inflate(r.menu.menu, menu);     return true;  }   @override public boolean onmenuitemselected(int featureid, menuitem item) {     // todo auto-generated method stub     switch (item.getitemid()) {     case r.id.about:                             about();                         break;     case r.id.help:                              help();                         break;     case r.id.exit:                              terminate();                         break; } return true; } 

i don't know in code use same except with

public boolean onoptionsitemselected(menuitem item) { 

instead of

public boolean onmenuitemselected(int featureid, menuitem item) { 

maybe try that. activity has particular meaning android. i'd call about(), help() , terminate() methods not activities.


Comments

Popular posts from this blog

c++ - Is it possible to compile a VST on linux? -

java - Output of Eclipse is rubbish -

jquery - Confused with JSON data and normal data in Django ajax request -