tags:

views:

351

answers:

2

Hi everybody,

Maybe this question has been asked already but I can't find any information about that even in the "Menu" section of Android's doc... So does anyone know if there is a way to set the menu out on an activity (to avoid the user clicking on the menu button of the phone)...?

A: 

I'm not quite sure what you are asking. The menu button is often a physical button on the phone, so you can't make it invisible if that is what you are asking. You can refrain from adding items to the menu. Then clicking the menu wouldn't do anything.

Jay Askren
No sorry dude, you misunderstood me. I have a menu, which pop out qhen i clic the menu button of the emulator. BUT I have my first activity where I would like the menu to be out without needing clicking on it...is it clearer?
Sephy
+3  A: 

Is this what you are looking for Sephy ?

Activity.openOptionsMenu()
Hubert
thanks very much. Had to look a bit about how to use it because it was triggering a crash when directely called in onCreate() (menu was trying to display but the view wasn't resolved and displayed yet.)So I solved the issue like that : new Handler().postDelayed(new Runnable() { public void run() { openOptionsMenu(); } }, 2000);
Sephy
great to hear that. Thanks for the upvotes. Have fun developing in Android ;-)
Hubert