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)...?
Is this what you are looking for Sephy ?
Activity.openOptionsMenu()
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.
Related
I am working on a simple application that is supposed to work on 800x480 tablet. Currently:
[][][][]
[][][][]
OOO
These are all buttons and they are working as expected. I, however, need to add menu items to the bottom-buttons. When clicked, menu items should pop up.
-Can I create a menu and place it at the bottom of the screen to replace those buttons? If so, could you show an example, cause I couldn't find any.
-Or, can I add menu items to these buttons?
What You want is an OptionsMenu, if I understand You the right way. I could give You an example later, I am not at home. But for now, look at this example. If You follow this, You donĀ“t need those buttons at the bottom.
http://www.edumobile.org/android/android-beginner-tutorials/options-menu/
if it is not clear, just let me know and I try to give You an example at the evening...
EDIT
for custom menu, You could use PopUpMenu. I had not tried this for now, but I think it is a good solution
http://android-er.blogspot.de/2012/03/example-of-using-popupmenu.html
In my application I am having 3 menu like options,setting and favorites. In that If I press 'favorites' means it should display another set of (new)menu and I want to hide the previous set of (old)menu. IS it possible with android? If anyone knows, help me please.
I'm not sure if this is possible, but it's not the bast idea to do such things. Main reason - this behavior will be unexpected for user.
On selecting option menu item you should show alert dialog with possible choices.
Offtopic: According new design guidelines Android will delete "menu button", and all actions will appear on action bar. May be this will be better for your purposes.
I have created an option menu for my app, but i want it to show up at the application start and be never hidden by any user control.
How can I? Is there a solution or i have to draw a custom menu in the layout?
How can I?
Don't make it an options menu. Use buttons or something.
If you want something to look like an options menu, please have it behave like an options menu, appearing when the user presses MENU and disappearing when the user makes a choice. Conversely, if you do not want it to behave like an options menu, then it should not look like an options menu, as that will confuse the user, wondering why your application or their phone is broken.
You have to place it in your layout.
I have an app in which I want to turn the menu button off (I'm picking up someone else's project and am not sure what is provoking the menu button to appear)... it doesn't *do anything. Is there a way to turn off that icon manually? Or do I have to hunt down the reason for its being displayed in the first place? (please no flak for looking for a workaround, obviously in an ideal world I'd be familiar enough with the code to know why the menu button is being generated, but time is of the essence and since it's a non functional button, I see no harm in just forcing it to go away).
TIA
Based on a suggestion here:
http://groups.google.com/group/android-developers/browse_thread/thread/c4b1b835060bd93f/4ed12919b4147008
I managed to get rid of the menu button on Honeycomb by setting my targetSdkVersion to 11 in my manifest:
android:targetSdkVersion="11"
If you do end up implementing some menu options, I believe they will end up being put into the little widget at the top right (don't know what it's called).
Is there a way to turn off that icon manually?
Don't have an options menu -- IOW, don't implement onCreateOptionsMenu() or onPrepareOptionsMenu(). Having an options menu is the only thing that causes the options menu button to appear on Honeycomb, AFAIK.
I've read through all of the android documentation that I can find but I'm still not clear on whether a button can be added to an application for an android device somewhere outside of an options/context menu. It seems like all of the menu buttons are only accessible either from a tab bar at the bottom or the menu button on the device. Is this correct?
I'm not sure I understand what you mean, but you can use a Button widget in an activity anywhere you want, just like any other widget type. See:
http://developer.android.com/reference/android/widget/Button.html