how to get menu handler

by sjia » Tue, 16 Dec 2008 06:28:18 GMT

Sponsored Links
 I'd like to disable a menu item in void onCreate(Bundle
savedInstanceState).  Is there a system call to get the menu handler?


how to get menu handler

by Dmaxi » Wed, 17 Dec 2008 07:19:48 GMT

 You can get the Options Menu instance for your activity from
onCreateOptionsMenu(Menu) method which is called only once when it is
initialized or from onPrepareOptionsMenu(Menu) method which is called
every time the menu button pressed.
See #onCreateOptionsMenu(android.view.Menu)
and #onPrepareOptionsMenu(android.view.Menu)


Sponsored Links

Other Threads

1. How to allow user to remove an activity form the Launcher

Use the PackageManager to disable that component.


2. Running a service once per day

Hi Folks,

I want to run a background service once per day (after the date changed at
midnight) and I don't want this schedule to be forgotten after a reboot. But
I was not successful when I tried to listen for DATE_CHANGED or TIME_SET

Currently I'm listening for BOOT_COMPLETED intent and do a manual schedule
using AlarmManager. Is this the intended way to do so? Or there is a better

Thank you,


3. AlarmManager - scheduled alarms after updating app canceled?

4. Picture location on HTC sense phones

5. Background image orientation

6. custom dialog crashing

7. What are the required interfaces to load and register a custom parser node and recognizer