Questions tagged [menuitem]

A menu item is a child element of a menu that provides the user a means to view and execute a specific application operation.

A menu item is a child element of a menu that provides the user a means to view and execute a specific application operation. A menu item may have an accelerator key which provides the user a quick way to execute the menu item operation. A menu item in turn can consist of other child menu items.

2533 questions
929
votes
15 answers

Sql Server 'Saving changes is not permitted' error ► Prevent saving changes that require table re-creation

When I create a table in SQL Server and save it, if I try to edit the table design, like change a column type from int to real, I get this error: Saving changes is not permitted. The change you have made requires the following table to be dropped…
Arash
  • 9,705
  • 4
  • 18
  • 12
374
votes
26 answers

How do I hide a menu item in the actionbar?

I have an action bar with a menuitem. How can I hide/show that menu item? This is what I'm trying to do: MenuItem item = (MenuItem) findViewById(R.id.addAction); item.setVisible(false); this.invalidateOptionsMenu();
Stir Zoltán
  • 4,033
  • 3
  • 16
  • 14
233
votes
13 answers

How to change menu item text dynamically in Android

I'm trying to change the title of a menu item from outside of the onOptionsItemSelected(MenuItem item) method. I already do the following; public boolean onOptionsItemSelected(MenuItem item) { try { switch(item.getItemId()) { case…
Garbit
  • 5,805
  • 6
  • 39
  • 72
216
votes
29 answers

How to change the Text color of Menu item in Android?

Can I change the background color of a Menu item in Android? Please let me know if anyone have any solution to this. The last option will be obviously to customize it but is there any way for changing the text color without customizing it.
sunil
  • 9,541
  • 18
  • 66
  • 88
149
votes
17 answers

How do I center align horizontal

I need to center align a horizontal menu. I've tried various solutions, including the mix of inline-block / block / center-align etc., but haven't succeeded. Here is my code:
Steven
  • 19,224
  • 47
  • 152
  • 257
146
votes
12 answers

Android: How to enable/disable option menu item on button click?

I can easily do it when I am using onCreateOptionsMenu or onOptionsItemSelected methods. But I have a button somewhere in screen, and on clicking that button, it should enable/disable context menu items.
Vikas
  • 24,082
  • 37
  • 117
  • 159
145
votes
6 answers

Handling a Menu Item Click Event - Android

I want to create an intent that starts a new activity once a Menu Item is clicked, but I'm not sure how to do this. I've been reading through the android documentation, but my implementation isn't correct..and some guidance in the right direction…
116
votes
13 answers

Android 4.3 menu item showAsAction="always" ignored

I'm using the new v7 appcompat library available starting from Android 4.3 (API level 18). Regardless of what is specified in showAsAction for a menu item, it's not shown - it always creates the overflow menu icon, and puts even a single menu item…
90
votes
12 answers

android: changing option menu items programmatically

Is it possible to change the option menu items programmatically? Can anyone provide me with an example please? Also, I want to disable certain items, so that they don't listen to the clicks, is it possible?
Farhan
  • 3,206
  • 14
  • 49
  • 62
70
votes
7 answers

Android : Get view Reference to a Menu Item

I plan to use quick actions UI pattern in my application. Android Quick Actions UI Pattern . The quick action window needs a pivot view to stick to. quickAction.show(View pivotView); I intend to use quick action for the menu Item, I can get…
Yashwanth Kumar
  • 28,931
  • 15
  • 65
  • 69
68
votes
9 answers

How to set icon color of MenuItem?

I defined a menu item that has ShareActionProvider and share white icon like so :
Dimitri
  • 8,122
  • 19
  • 71
  • 128
63
votes
6 answers

How can I dynamically create menu items?

I'm building an Android application and I'm trying to build a user management system where users can login, logout, etc. I want to display a login menu item if the user is logged out and a logout button if the user is logged in. How can I do this…
Johnathan Au
  • 5,244
  • 18
  • 70
  • 128
62
votes
3 answers

How to add submenu items to ActionBar action in code?

Via xml I can add submenu items to my action in the ActionBar. main_menu.xml:
Mathias Conradt
  • 28,420
  • 21
  • 138
  • 192
58
votes
6 answers

WPF - how to hide menu item if command's CanExecute is false?

By default menu items become disabled when its command cannot be executed (CanExecute = false). What is the easiest way to make the menu item visible/collapsed based on the CanExecute method?
Gus Cavalcanti
  • 10,527
  • 23
  • 71
  • 104
56
votes
3 answers

WPF menu item with image

How to define MenuItem.Icon so that the MenuItemHeader text would be placed below the menu item image?Thanks for help!
Vytas
  • 1,271
  • 4
  • 18
  • 26
1
2 3
99 100