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.
Related
Screenshots Below. As you can see, my menubutton is showing up in the actionBar's overflow area. It doesn't work well on portrait, because it adds a second row (cannot fit next to my tabs, obviously); it looks okay on landscape, but I will be changing the way the tabs present themselves on landscape, so it'll end up having the same problem as portrait. So, what I need to accomplish, is getting the menu button into the bottom black area of the screen, which, my understanding says is actually legacy support. Is there no method to declare to send my menu button down to the right of task switcher as I've seen in some other apps? Is the solution to change my targetSDKversion in AndroidManifest?
Can't be done, as can be seen via CommonsWare's link :(
I have an app that in a certain Activity (drawing) can be in any one of a number of states, such as draw, erase, select, etc.
To enable these states, I've got a button for each in the ActionBar, but one thing I'd like to do is to 'show' the user which state is enabled by keeping the button pressed active or pressed until I turn it off (when they have switched state by pressing one of the other buttons).
Searches here and other places have me coming up blank... can anyone recommend a possible solution? I've though about rolling my own toolbar, and while this might be my final solution, using the ActionBar would speed things up greatly at this point.
Thanks.
There is no direct way to do that, as far as I know, but you could implement your custom component to do that. However, my advice to you is having a separate toolbar that's not on the action bar, since the users expect all buttons on the Action Bar to be "Action Items" which perform something immediate, so having toggle items on the Action Bar might break this expectation. This allows you to save space on the action bar for things that the user expects to see there like: navigation, "Undo", "Save", "Delete"...
I agree with Bruno about the fact its probably best if you do it in a separate toolbar for the sake of user experience standard and your code will probably look better because you cant fully customize the action bar but if you do decide to go with it i can think of something really simple like, when clicking one of the menu buttons you set the pressed button to a new drawable (pressed button) and the others to their normal drawable (not pressed) so each menu icon will have a pressed and not pressed icon. you will have to invalidateOptionsMenu though.
I had the same problem and did not find a solution. However, I found a workaround that works for me:
In the onOptionsItemSelected(MenuItem item) method, if item is the button you want to toggle, simply call item.setIcon() and point to another drawable. I use the same image but with another color to show the user that the button is in "pressed" state. And when the button is pressed again, revert to the original drawable.
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'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
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.