menu capability - android

Is there any way to do a popup menu that is activated by a process within the program, such as the JPopupMenu class of Swing? All I can find in the android literature is an options menu that can only be activated by pressing a menu button, and the context menu that can only be activated by a long press.

You can use a TranslateAnimation
Maybe this is also helpful: http://developerlife.com/tutorials/?p=343

Related

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

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.

How to call context menu in Android emulator

Making this tutorial: http://developer.android.com/resources/tutorials/notepad/notepad-ex1.html I have ListActivity-derived class and onCreateContextMenu, onContextItemSelected overrides. I think that it is like in Windows listbox: right-click listbox item, select popup menu item. However, I don't know how to execute this function in Android simulator: right-click on ListActivity item doesn't work, and I cannot see ContextMenu.
So, what should I do in Android emulator to see the context menu?
Long click on list using mouse until options appears .
Since the Android is designed for hand helds, there really is no idea of right clicking. On a hand held, the context menu is brought up with your finger by pressing a list item and holding until it comes up. In the simulator this becomes a click the mouse and hold.

Android make a case sensitive menu option

I want is a go from a menu that has a list of objects, if you select an option menu another list should appear.
The examples I found seemed to be for listview or webview.
There another way to make a selection from menu options?
So if I'm understanding your right, you want to launch a Context Menu from an Options Menu. You should not do this. From the android documentation:
A context menu is conceptually similar to the menu displayed when the user performs a "right-click" on a PC. You should use a context menu to provide the user access to actions that pertain to a specific item in the user interface. On Android, a context menu is displayed when the user performs a "long press" (press and hold) on an item.
You'd never do a "long press" on an Options Menu item. People just aren't used to doing that.
Try launching another activity instead or using a dialog.
If you have a fixed list of options in mind you might be looking for submenus, which are explained here: http://developer.android.com/guide/topics/ui/menus.html
If you are looking to dynamically build a list of options with an adapter you might find AlertDialog.Builder useful along with its setAdapter method.

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

Opening ContextMenu by Clicking a Button in Android

How to open the ContextMenu in Android by Clicking a Button?
A context menu is conceptually similar to the menu displayed when the user performs a "right-click" on a PC. You should use a context menu to provide the user access to actions that pertain to a specific item in the user interface.
On Android, a context menu is displayed when the user performs a "long press" (press and hold) on an item.
Alternatively, if you need a button, you can implement the menu for the view and change the content dynamically.
Your question is bad and you should feel bad, given how readily available (if cryptic) the method behind this process is. This small tutorial helped me greatly.
http://www.mikeplate.com/2010/01/21/show-a-context-menu-for-long-clicks-in-an-android-listview/

Categories

Resources