MBraude wrote: > Hi Everybody, > > I'm sure this is an easy thing to do, but I haven't run into an > example yet that responds to the user clicking the Menu button on the > phone. I'd like to be able to show / hide some things based on this > click event. What's the easiest way to do this?
The Menu button pops up the options menu for the activity. To fill in that menu, you need to implement onCreateOptionsMenu() in your activity and populate the supplied Menu object, per the docs: http://preview.tinyurl.com/5ebu4s LinearLayout8.java in the SDK's ApiDemos shows the use of the options menu. I'm sure there are any number of tutorials up on anddev.org as well. The code bundle at http://commonsware.com/Android/ also has sample code for both the options menu and the context menu (a.k.a., "long tap" menu). I think there was an earlier post in one of these Google Groups from a Googler that indicated using the Menu button for anything else other than the options menu is uncool. -- Mark Murphy (a Commons Guy) http://commonsware.com _The Busy Coder's Guide to Android Development_ -- Available Now! --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Android Beginners" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [EMAIL PROTECTED] Announcing the new M5 SDK! http://android-developers.blogspot.com/2008/02/android-sdk-m5-rc14-now-available.html For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en -~----------~----~----~----~------~----~------~--~---

