My app has an extended menu and has been working on all legit devices from Android 2.1 up thru 4.1. For R11+, to save screen space, I do not display the Action Bar on "normal" screens, but do on "large" and "xlarge". With the Action Bar present, the menu icon is on the Action Bar in the upper right corner; on normal-size screens, without hardkeys, it is at the lower right in the bar with the Home and Back buttons. This is functioning as expected on the latest phones and tablets.
Now I've had two customers with some sort of direct-from-China-on-eBay 7" tablet running Android 4.0.4 who are not seeing either the Action Bar or the menu icon in the Home/Back bar. I see two malfunctions here: first, that it must be reporting its screen as "normal" since it's using the "NoActionBar" theme; and secondly that it's not then showing the menu icon in the bottom bar. The users state that this device has access to Google Play, so I assume it's an approved device.
Has anyone run into anything like this? The only solution I can see -- since I don't want to activate the Action Bar on everyone's smartphone -- is to add a settings option to display the Action Bar. Any other ideas?
Related
I want to move the overflow button (that shows up the options menu) actually present in the top action bar to the bottom action bar. As actually done by Facebook application and many other applications. I want this for tablet only.
Screenshot:
Thanks.
First, neither of those screenshots show a "bottom action bar". They show the navigation bar.
Second, whatever is shown in your second screenshot is non-standard.
My guess is that second screenshot is supposed to be the legacy menu affordance. The objective of a modern Android app developer is to not show the legacy menu affordance, as it is an indication to users that your app is not being maintained. Modern Android apps have the overflow menu in the action bar (for devices without a dedicated MENU button).
That being said, if you wish to have fewer users, and therefore want to suggest to those users that your app is unmaintained, to have the legacy menu affordance, get rid of your action bar, such as by setting android:targetSdkVersion to 11 or lower.
You can read more about this in the documentation.
How do you show an options menu on Honeycomb, or an ICS tablet, without an action bar?
After some playing around, it seems there is no way to have an options menu on Honeycomb devices if there is no action bar and targetsdkversion is >=11. Even if your theme is Theme.Holo.NoActionBar. The only way I can see to show an options menu on Honeycomb with targetsdkversion>=11 is with a theme that does have an action bar, and then hiding it in onCreate.
The only way I can see to display the older panel menu on Honeycomb is with targetsdkversion<=10.
In summary, in Honeycomb, there is no way to have an options menu if you don't have an action bar, unless you target below 11. This seems like a bug. In ICS and up you can
have whatever options menus you like, regardless of if you actually have an action bar.
My original goal was to be able to use both the old style panel menu, and new Action Bar menu (in different activities) on Honeycomb and up, while using the panel menu everywhere below Honeycomb.
The reason is there is one activity where it is a requirement to have large menu buttons, however the rest of the app can be perfectly Holo-ed.
To achieve this, I have used Theme.Holo (for api 11+) everywhere except for this one activity where I use Theme.NoTitlebar. I have android:minSdkVersion="5" android:targetSdkVersion="14", so the support menu key doesn't show (and thus doesn't waste screen space on some new HTC phones). I provide my own button to pop up the panel menu if the device doesn't have a hardware menu button (via http://developer.android.com/reference/android/view/ViewConfiguration.html#hasPermanentMenuKey() )
The problem is, this didn't work on a Honeycomb tablet (Galaxy Tab, Honeycomb 3.2). The normal activities with the action bar work fine, but on the special activity nothing happens when I press the menu button (the one I've provided in the UI).
This works fine on at least 2 ICS phones and the emulator (with and without a hardware menu key). Normal action bar menus everywhere except on this one activity, where I get the large panel menu.
So what is the solution? Is this a problem with the Galaxy Tab or with Honeycomb? Is there a different theme I should be using to provide the panel menu?
Edit: I obtained an ICS tablet for more testing, and found the panel menu didn't appear there either. So the exact same app, on the same version of Android, will show a panel menu on a phone and nothing on a tablet. Huh?
Below is an extract from the PhoneWindow system class as for Honeycomb and above Android versions. It is really hardcoded check for Android target version and device screen size. Would you be able to avoid this check - the menu would be displayed normally. But there is no such possibility. That is why it is impossible to show options menu on Honeycomb+ devices with target sdk set to value above 10. It is funny, that in case action bar menu could be displayed, it will be displayed earlier and this code will never be reached. Because of this, the comment above the code looks especially derisively.
// Don't open an options panel for honeycomb apps on xlarge devices.
// (The app should be using an action bar for menu items.)
if (st.featureId == FEATURE_OPTIONS_PANEL) {
Context context = getContext();
Configuration config = context.getResources().getConfiguration();
boolean isXLarge = (config.screenLayout & Configuration.SCREENLAYOUT_SIZE_MASK) ==
Configuration.SCREENLAYOUT_SIZE_XLARGE;
boolean isHoneycombApp = context.getApplicationInfo().targetSdkVersion >=
android.os.Build.VERSION_CODES.HONEYCOMB;
if (isXLarge && isHoneycombApp) {
return;
}
}
With some divice android has got 3 button: Home,Menu and Back at the bottom.
But some divice android phone hasn't got 3 button: Home,Menu and Back.
How show 3 button Home,Menu and Back at bottom of screen as Action Bar?
AS:
This is not an action bar. This is the navigation bar, available on some phones. Specifically, it will be on phones that are running Android 4.0 or higher and do not have off-screen affordances for these keys.
How show 3 button Home,Menu and Back at bottom of screen
This is handled at the firmware level. The device manufacturer will set up the firmware to display the navigation bar where needed. You cannot add a navigation bar for devices that do not need one via the Android SDK.
I should prefer to totaly hide the bottom status bar in android tablet (Androide 3.x and 4.x), but it seems to be impossible, because the new android version removed the physical keybutton from devices. Therefore I would at least remove from the bottom status bar, the clock, battery icon, and others. I only want the "Back", "Home" and "Options" buttons. It's possible?
http://developer.android.com/design/patterns/actionbar.html#considerations-split-action-bars In tablet devices, when set Full screen mode, the BottomBar and notification bar (including clock and other) are merged. I practically want hide the notification bar side.
Therefore I would at least remove from the bottom status bar, the clock, battery icon, and others. I only want the "Back", "Home" and "Options" buttons. It's possible?
If you make your own ROM mod with your own modified build of Android, yes. An SDK application cannot remove items from the system bar.
I'm On Honeycomb (3.1) and my first problem is that I don't know what is the name of the bar at the bottom of the OS (appears in every application). I've seen some apps add options to this bottom bar (it has by default the back button the home button and the show active programs button, besides the watch, battery indicator and signal connection strength). When a certain program uses options it sometimes adds them to this bottom bar (it is usually seen as a grid-like icon next to the show active programs buttons, which you can click and a menu pops up.
I've described it as best as I can, but My question is simple: how can I create a menu like this on in my app?
Thanks for any help!
EDIT:
Ok, I've just read it's a compatibility feature. And it's not supposed to be there in an Android App.
I feel stupid...
I'm On Honeycomb (3.1) and my first problem is that I don't know what is the name of the bar at the bottom of the OS (appears in every application).
That is the "system bar".
I've seen some apps add options to this bottom bar
This happens automatically for applications that set up an options menu using onCreateOptionsMenu(). However, once the application switches to the Honeycomb look-and-feel (e.g., via android:targetSdkVersion="11"), the options menu moves to the action bar.
how can I create a menu like this on in my app?
Long-term, you do not want to do this, because it means that you will not have the action bar and will not look like you belong on Honeycomb, Ice Cream Sandwich, etc.
Short-term, simply do not have android:targetSdkVersion="11", and implement an options menu as normal.