Action bar overflow not displayed - java

I'm setting up an action bar with Sherlock with 3 items/icons.
Running on a ICS emulator, I only can see 2 icons. And moreover: NO overflow menu (those 3 dots-icon)!
I only get the 3rd icon if I press the menu button of the phone.
Do I have to force the overflow icon, and if so how can I do so?

Do I have to force the overflow icon, and if so how can I do so?
All you need to do is have your theme inherit from one of the .ForceOverflow themes. Note this will only work for Android 2.0 and 3.0. In 4.0 the native ActionBar component is used instead, and the overflow item is only displayed if the device does not have a menu key.

Do I have to force the overflow icon
No.
Your emulator is set up, by default, to emulate a device that has an off-screen MENU key, like the Nexus S. Such devices will not have an on-screen overflow menu button -- users will use the MENU key to access the overflow. Many of those devices, like the Nexus S, will be ones upgraded from Android 2.x, where the user will already be used to pressing the MENU key to get what used to be the options menu and now is the overflow menu.
You can switch your emulator to emulate a device without an off-screen MENU key. In your AVD Manager, for an AVD, add the "Hardware Back/Home keys" property (which, despite the name, also has the MENU key) and set it to be true or false as you wish.

Related

Android - how to add a [Toggle button] in the Notification Panel ? (the place where you can toggle Wifi, bluetooth, Plane Mode, ect ..)

I'm trying to make my app add a toogle button in the [Notification Panel] the place where you can toggle Wifi, bluetooth, Plane Mode, ect .., (I've spent the last 6 hours searching and I found nothing)
Here's are 2 Examples of what I'm talking about in one picture :
-In the 2 blue frames, those 2 buttons are custom buttons (meaning they have nothing to do with stock android, they've been added by apps from the Playstore),
#1 button : The Shazam button is a shortcut to open shazam (that's not what I need, although would love to know how it's done)
#2 button : First press it starts recording a video on my rear camera (the button becomes activated (blue)), second press it stops recording and saves the video, all this happens in the background, the app that does this never opens (meaning that this is not just a shortcut to the app)
=> So I'm trying to do is to have a custom button for my app, a button like the #2 button, for my app activating/disabling it would make my app's background service send TCP messages to a server, (just in case you want to know what I'm trying to do)
My phone is not Rooted, and I know for a fact that this doesn't require a Rooted phone.
(I'm trying to do this with Xamarin/c#)
sadly no one answered, so i kept searching and i found out that what i called the Notification Panel Menu, was in fact called the "Quick Panel" ..
anyways, here are some links that helped me quite much : Link 1 , Link 2

How to hide notification icons in Android Status Bar?

I'm working on a German Learning app project, inspired by Duolingo app.
I need to make my app to be a little bit similar with this feature. It's like making the user to focus on the quiz, and ignore everything in status bar (notification bar). Now, what I need is i want to hide the icons on notification bar. Is there a way to do so?
This is what I want
And this is the fact
You can dim the status and navigation bars by setting the SYSTEM_UI_FLAG_LOW_PROFILE flag.
View decorView = getActivity().getWindow().getDecorView();
decorView.setSystemUiVisibility(View.SYSTEM_UI_FLAG_LOW_PROFILE);
https://developer.android.com/training/system-ui/dim.html
This decoration is reset whenever the keyboard is made visible, but you can watch for the keyboard being hidden (using an onGlobalLayoutListener) and resetting the flag.
You could just disable notifications for the offending apps in your device's settings menu. I'm looking for an option to hide them from the status bar while keeping notifications in the shade and on the lock screen. Apparently not on a Samsung device.

i want to know what is this window in android?

it's a youtube app and I want to know how to add the configuration window
It is called overflow menu.
See the image and its description below: Google Design Guidelines - Menu.
The action overflow in the app bar will emit a menu.
This particular action overflow menu contains four menu items: Refresh, Help & feedback, Settings, and Sign out.

Corona SDK android keyboard and native textFields

I'm developing an app for iOS and Android using Corona SDK and have problems with managing native textFields in Android.
I'm trying to achieve the following effects:
tapping on textfield will animate its sliding with keyboard so it will be always on top of it while moving up.
Tapping on back button will dismiss the keyboard and slide textfield back with it
My problems are:
To know the height of the keyboard in order to know where to stop moving the textfield.
To catch back button tap in order to eliminate the textfield
What I am doing:
I've looked over the Internet to find out how to check keyboard height on Android. All solutions assume we have Activities.
We have registered onKey listener to catch back press in corona code, but it is not fired if keyboard shown.
Ok so I made this Draw & Guess Online game and I used Native TextFields as well. What I did is just set my device resolution to lets say 600x1024. Then I just tested on a few different devices, and just eyeballed where the keyboard was located. I'm afraid this is what your going to have to do. Just use a for loop to make around 10 small rectangles and print the pixel values next to each of them. Then take your test devices, and see where the keyboard lyes on each device. Then just animate them up.
There is no easy way to do it in Corona unfortunately. Also people could have custom keyboards which would make your life even more difficult. All I can recommend is to over estimate and release.

Disable some/all radio buttons in Android preference

I have searched and searched Google, Stack Overflow, etc. for an answer to this and failed!
I wish to programatically disable/enable selected radio buttons in a single Android preference.
For example, there is a radio button preference with 6 choices, but depending on some condtions (not related to the preferences) some of them will be unselectable and should be shown as disabled.
I can see how we can disable complete radio button groups, but not individual radio buttons
Can Anyone help?
AFAIK, this is not supported by the built-in ListPreference. You are welcome to write your own custom Preference, or perhaps extend ListPreference, where you supply your own Adapter and disable certain items that way.

Categories