Menu button disappears when action bar is hidden in Kitkat - android

I'm developing an android app which doesn't have an action bar. I have the sign out and sync options as menu items. When I tried this in my Nexus 5, the menu button is nowhere to be found. It usually appears in the action bar. Is there a way to keep the menu button and hide the action bar at the same time?

Is there a way to keep the menu button and hide the action bar at the same time?
No. If you are not going to use the action bar, you cannot reliably use <menu> resources. Please put "sign out and sync options" in your own GUI, such as via buttons.
Note that the MENU key is itself deprecated now; few devices going forward will have one.

Related

What is the difference between Option menu and Overflow Action Menu in android?

I have searched for Option menu and overflow Action menu, but did not get any difference in both.
Is there any difference or both are exactly same?
The option menu is used on Android 1.x/2.x devices, for apps that are not using an action bar backport (e.g., appcompat-v7).
The overflow menu in the action bar is used on Android devices that have an action bar, either the native action bar or a backport.
Menu items, such as those defined in onCreateOptionsMenu(), will go into an options menu on devices and apps that use it, or will go into the action bar on devices and apps that use one of those. Menu items not specifically designated to go into the action bar as toolbar-style buttons or other widgets will go into the overflow. Menu items that do not fit in the action bar will also go into the overflow.
Android uses the old options menu terms (e.g., onCreateOptionsMenu() instead of onCreateActionBarItems()) for backwards compatibility, so apps can be written to use the native action bar and still work, to some extent, on devices that lack an action bar.
There only exists one options menu. If the device has a menu key, then the overflow menu items appear when the key is pressed. On the other side, if the device has not menu key, then they appear on the action bar overflow icon.

No options-button shown with Android 2.2 build?

until now I compiled my app with SDK for Android 2.1. There the options/preferences button appeared automatically, I only had to bring it alive by providing methods onPrepareOptionsMenu() and onMenuItemSelected().
Now i switched over to SDK for 2.2 and my whole layout is...hm...damaged. Most obvious problem: the options-button is gone.
So what do I have to do to re-enable it for 2.2?
Thanks!
There the options/preferences button appeared automatically
There has never been an "options/preferences button" in Android that "appeared automatically". I am going to guess that you mean the legacy menu affordance in the system bar/navigation bar on Android 3.0 devices, for apps with android:minSdkVersion set too low.
So what do I have to do to re-enable it for 2.2?
The legacy menu affordance has nothing to do with your build target. It has everything to do with your android:minSdkVersion. More importantly, your objective should be to get rid of this affordance, as it is a sign to users that your app is out of date.
If you are using onPrepareOptionsMenu(), you should be using the action bar, in which case your former menu items will either appear in the action bar directly as toolbar-style buttons, or in the action bar's overflow menu ("..." button), or via a popup menu that appears when the user presses their device's MENU button.
If you do not want the action bar, then do not use onPrepareOptionsMenu(). Instead, create your own menu structure using your own widgets as part of your own activity UI.
You can read more about the action bar and the vanishing menu affordance in the documentation.

Android ICS Options menu with images

I am new to android.
How can i create option menu with out images like in the attached image? Do i need to use action bar or normal onCreateOptionMenu will do?
If you've developed your application for Android 3.0 (API level 11)
and higher, items from the options menu are available in the action
bar. By default, the system places all items in the action overflow,
which the user can reveal with the action overflow icon on the right
side of the action bar (or by pressing the device Menu button, if
available). To enable quick access to important actions, you can
promote a few items to appear in the action bar by adding
android:showAsAction="ifRoom" to the corresponding elements.
You can refer this doc for more detail.

Docked Settings Button override for Android

I am developing on a Galaxy Nexus, and I would like the settings icon on the main dock to open up some window of buttons. How do I go about handling this button press? it's that button that looks like a vertical "..."
That button:
will only appear on devices without a MENU button
will only appear if you have action bar items in the overflow menu
cannot be directly used for other purposes
You are welcome to have an action item in the action bar that will "open up some window of buttons". You can choose whatever icon you want for this action item. I strongly encourage you to not use the same icon as the action overflow menu. There are millions of possible icons, so surely you can choose one of greater relevance to whatever the "window of buttons" is and will not conflict with the users' expectations of what the action bar overflow should look and work like.

using action bar sherlock

i'm pretty confused on how to use action bar sherlock.. i've 'installed' it successfully in my apps (I can already see the bar at the top of my apps), but how do I 'configure' it? for example i use this
<item name="abDisplayOptions">useLogo|showHome|homeAsUp|showTitle</item>
so I can see the apps logo in the action bar, the 'back' button at the left side of the logo, but I don't know where should I put the code (and what code to write) to enable the 'back' buttons on action bar, clicking on logo will bring the user to the apps home, and other things such as put a search icon on the action bar and so on.. i tried looking at the actionbarsherlock google groups but I don't know what to search to help me...
Just check the samples here : https://play.google.com/store/apps/details?id=com.actionbarsherlock.sample.demos
And the corresponding code here : https://github.com/JakeWharton/ActionBarSherlock

Categories

Resources