In my app i have to develop a menu using grid view with the icons and a shortcut button for easy switching of language options. So when the user clicks this button, 'English Menu' should switch to 'Urdu Menu' and vice-versa. So do i have to make two menu activities : one in English and on in Urdu and keep switching between them using intent or i should use toggle button instead ? Please suggest. Thanks!
I added all the menu items (in your case, both English AND Urdu menu items) into my menu xml file. And I grouped them as you see here (Menu Resource). And per button click, I set their visibility to either true or false.
(Edit) This is a function in Android Menu class:
setGroupVisible(int group, boolean visible)
Show or hide all menu items that are in the given group.
Related
I have a main menu in my app that allows the user to do a set of specific tasks. On the app, I have a menu button akin to what Facebook have (three horizontal bars as a button). I'd like it to open when the physical Menu button on the Android phone was pressed.
Can this be done?
Is it possible to create a menu in android that shows when someone for example touches a graph and It brings more options. I want a menu that will appear from above and below like how the menu used to be in android when you touch the menu button. Now without the button i would like the user to touch a chart or a table and two menus appear from above and below or even sides. Any suggestions will highly be appreciated
Suggestion:
Make the layout of menu you would like to show, and include it in the layout of your activity.
By default set it to be GONE, this will hide it.
Then set a touch listener for your graph, and change the visibility of menu to VISIBLE to show it.
I think what u need is a context menu; see this example Hope this helps :) cheers :)
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.
I want to add action on clicking the Menu button on Android device. Suppose user is seeing Graph (one activity) now and he wants to switch to Charts. When user clicks the Menu button it has to show submenu say "Chart" this will be another activity. and then the user will switch to Charts.
How i can accomplish with this? can anybody guide me?
override onMenuItemClicked function and call startActivity()
to add Menu item to an activity you need to override
onCreateMenuItem function.
Is it possible to have something similar like Blackberry in Android:
link text
I want to add a menu item particularly to the Contacts Option menu.
please let me know if this can be done in android.
Can you specify more clearly what you're trying to achieve / where you want to add the menu.
The menu that appears when you press the menu button on BB is equivalent to the menu options that come up when you press the menu button on Android.
Talking about the Contact application on Android, this would be the menu with the menu items "Search, Display options, Get Friends, My Profile, ..." in the Contact app's list view.
Take a look at http://developer.android.com/reference/android/view/Menu.html