Intercept onOptionsItemSelected

I have a top level TabHost that implements the onCreateOptionsMenu method. And I want sub-activities (those within the tabs) to be able to intercept the options menu via onOptionsItemSelected. Like for example, in the options menu I have an item called, "Edit Note" and in one tab there is a ListView with a list of all the notes. I want the "Edit Note" item to be able to be viewed throughout the application, but the top level TabActivity doesn't know information such as title or id of the note.

Answers


Subclass the tabs, and have the parent call down to the active child in the OnOptionsItemSelected to give it the chance to handle it first.


Need Your Help

When is messaging (e.g. JMS) an alternative for multithreading?

java multithreading jms jboss-mdb message-passing

I work on a data processing application in which concurrency is achieved by putting several units of work on a message queue that multiple instances of a message driven bean (MDB) listen to. Other ...

Is flash's geturl(...) spiderable by google?

flash seo web-crawler geturl

If I made a homepage with an embedded .swf which had buttons that linked to other html pages on my website using the getUrl() function, would those links be spiderable by google? Or should I also p...