Don't close Option Menu when a menu item is pressed - android

For an options menu, I have 5 buttons, and would like the menu to stay present if one specific button is pressed. How may this be accomplished. Thanks!
Looking at the Android docs, I see there is a relevant constant FLAG_PERFORM_NO_CLOSE, but I am not sure how to apply it.

Related

How can I make a button act like a menu?

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

How can i force an option menu to show up on android?

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.

How do I control the soft menu button in Honeycomb?

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.

Can I create a menu button somewhere other than the options menu in android?

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

add menu item to android applicaton

Is it possible to have something similar like Blackberry in Android:
link text
I want to add a menu item particularly to the Contacts Option menu.
please let me know if this can be done in android.
Can you specify more clearly what you're trying to achieve / where you want to add the menu.
The menu that appears when you press the menu button on BB is equivalent to the menu options that come up when you press the menu button on Android.
Talking about the Contact application on Android, this would be the menu with the menu items "Search, Display options, Get Friends, My Profile, ..." in the Contact app's list view.
Take a look at http://developer.android.com/reference/android/view/Menu.html

Categories

Resources