views:

378

answers:

1

Duplicate: static options menu

Hi everyone,

I know how to create a menu in my application with an icon and text on each "button" of the menu, but this menu is only visible on the activity where I created it... I would like to know if it is possible to create a global menu which would be accessible from all activities? thank you

A: 

I would like to know if it is possible to create a global menu which would be accessible from all activities?

Not really. Since you didn't like the inheritance solution, the only alternative is to consolidate the menu creation and handling code in one place (e.g., static methods). You would still need to implement the callbacks on each activity (e.g., onHandleOptionsMenu()) and route them to the static common implementation.

CommonsWare
Yeah thx, I finally chose this way (inheritance) of doing as I said on the other post.thx for help
Sephy