If I read your question correctly you want the same menu in all your Activities. I can think of two ways to do this:
Create a subclass of Activity
that implements onCreateOptionsMenu()
and onOptionsItemSelected()
(and possibly onPrepareOptionsMenu
). Then have all your Activity
classes extend this subclass.
Create a static method somewhere called something like populateOptionsMenu()
that takes a Menu
(and probably a Context
) as arguments. Your Activity
classes can then call this from their onCreateOptionsMenu()
methods to populate the Menu
. You'd also need a corresponding processItemSelected()
static method for when items were clicked.
Option 1 seems best as it wouldn't require the same bolierplate in your Activities to call the static methods.