Questions tagged [optionmenu]

An optionmenu is a UI construct that presents the user with a list of options.

optionmenu
Filter by
Sorted by
Tagged with
145 votes
6 answers
328k views

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 ...
Jade Byfield's user avatar
  • 4,738
90 votes
12 answers
118k views

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 ...
Farhan 's user avatar
  • 3,206
48 votes
6 answers
77k views

How can I get the options menu of my Activity?

In some methods of my Activity I want to check the title of menu or know if it is checked or not. How can I get Activity's menu. I need something like this.getMenu()
Bob's user avatar
  • 22.9k
45 votes
6 answers
52k views

How can I alter a MenuItem on the Options Menu on Android?

I have an Options Menu on my Activity with an MenuItem "Start". When this MenuItem is selected I would like to alter the Menu so it contains a MenuItem "Stop". And finally when "Stop" is selected, I ...
Jonas's user avatar
  • 125k
39 votes
6 answers
36k views

SearchView in OptionsMenu not full width

I have a working SearchView which expands in my OptionsMenu when the user taps on the search icon. However it only expands within the available space among the other OptionsMenu icons. On a wide ...
Peri Hartman's user avatar
  • 19.4k
36 votes
4 answers
49k views

What does onPrepareOptionsMenu do?

I want to make Option Menu for Android, I have visit this site. In their script, I found onPrepareOptionsMenu, I try to compile and run using Android 2.3.3 compiler with and without ...
Tutompita's user avatar
  • 649
29 votes
4 answers
3k views

Callback when the options menu creation is complete

I need to make sure that the options menu has been created before i run a certain code that accesses one of the menu items. Is there a callback for that or how can i implement one? Is there any ...
Mak's user avatar
  • 543
27 votes
3 answers
36k views

How to hide option menu?

I am using option selected menu item, attached three item (share, login, logout) am select login item, go login activity login social sign (Facebook or google) any one, if login hide login item at ...
Krishnan's user avatar
  • 428
25 votes
4 answers
72k views

Android: onCreateOptionsMenu() item action

I have a menu created through: @Override public boolean onCreateOptionsMenu(Menu menu) { menu.add("Email"); return super.onCreateOptionsMenu(menu); } But I can't remember how to set a ...
Nick's user avatar
  • 9,333
22 votes
5 answers
34k views

Show Menu item always in support action bar

I am working on android application . I have implemented supported action bar in it .I want to show option menu item always . But it is not showing . it is showing in drop down menu . my code for menu ...
Nitesh Kabra's user avatar
22 votes
5 answers
55k views

how we can add menu item dynamically

hi frnds am creating an application which is a tab application. in my Home which extends sherlockFragmentActivity, i am inflating menu.xml and includes code for on optionMenuitem click listener. The ...
Vikky's user avatar
  • 943
22 votes
5 answers
19k views

tkinter optionmenu first option vanishes

A ttk optionmenu widget starts out with all of its values in the dropdown. Upon selecting any value, the first value in the list vanishes, never to reappear... Does anyone know why? Is this a ...
Tom's user avatar
  • 381
21 votes
1 answer
53k views

Android Option Menu on Button click

I am trying to show the Option menu on button click.How can I do this can anyone tell me.
Altaf's user avatar
  • 5,170
19 votes
2 answers
19k views

Change OptionMenu based on what is selected in another OptionMenu

I am currently trying to make two OptionMenus, where the second will be updated dynamically based on what is selected in the first OptionMenu. For example, I would like to make OptionMenu_A with list ...
user2511875's user avatar
18 votes
4 answers
46k views

Changing the options of a OptionMenu when clicking a Button

Say I have an option menu network_select that has a list of networks to connect to. import Tkinter as tk choices = ('network one', 'network two', 'network three') var = tk.StringVar(root) ...
charmoniumQ's user avatar
  • 5,373
18 votes
1 answer
23k views

Android - Refresh Options Menu without calling invalidateOptionsMenu()

Hello Android Developers, I have seen a lot of question regarding the update of Options Menu. However, every answer says I have to call invalidateOptionsMenu(). My question is, is there any other way ...
Michael 'Maik' Ardan's user avatar
17 votes
3 answers
32k views

Android options menu icon won't display

I'm following a book on Android Development to get myself started writing my first real app. I got up to the point where I'm making an options menu for one of my activities. The menu shows up, but the ...
Jort's user avatar
  • 1,401
16 votes
4 answers
13k views

Changing default icon in tkinter OptionMenu?

I am trying to remove the default "box like" icon from the tkinter OptionMenu and replace it with my own image file. below is the code I have to date. It is working but I had to add the last line to ...
user avatar
15 votes
5 answers
41k views

How to make a OptionMenu maintain the same width?

I have a snippet which creates an OptionMenu widget. ... options = ('White', 'Grey', 'Black', 'Red', 'Orange', 'Yellow', 'Green', 'Blue', 'Cyan', 'Purple') var = StringVar() optionmenu = ...
rectangletangle's user avatar
15 votes
2 answers
30k views

How to change menu background color of Tkinter's OptionMenu widget?

If I take a simple example of OptionMenu from http://effbot.org/tkinterbook/optionmenu.htm, and add a line that sets background color (see below), only the button background changes color, not the ...
Victor's user avatar
  • 346
14 votes
4 answers
16k views

Android: How can I set a listener to the MenuButton?

I want to do a custom action when pressing on the Menu button on the phone. Is it possible to set an onClickListener (or similar) on the button and if so, how? onCreateOptionsMenu is only called the ...
whlk's user avatar
  • 15.6k
14 votes
2 answers
32k views

Default to and select first item in Tkinter listbox

I want to automatically select the first item in the listbox. By selecting the first item, I don't mean simply defaulting to the first item or setting focus on it. I've already achieved that by doing ...
sedeh's user avatar
  • 7,213
14 votes
5 answers
18k views

detecting a click on action bar back button -(OnOptionsItemSelected not calling when click on action bar back button)

I have an action bar containing a searchview. When user click on the search button and collapse the search view the action bar shows a back button on the left side. How can we detect when user click ...
Husein Behboudi Rad's user avatar
12 votes
5 answers
11k views

Setting content description for option menu android Talkback

I am implementing "Read Aloud" or "Talkback" for an app. Everything is working with contentDescription text, but with option menu, I found nothing related to contentDescription, I want system read "...
NamNH's user avatar
  • 1,777
12 votes
2 answers
23k views

How do populate a Tkinter optionMenu with items in a list

"I want to populate option menus in Tkinter with items from various lists, how do i do that? In the code below it treats the entire list as one item in the menu. I tried to use a for statement to loop ...
kflaw's user avatar
  • 424
11 votes
3 answers
9k views

Android ActionBar Recreate Options Menu

When using the ActionBar in Android, how do you refresh the options menu? I have tried hiding and showing the bar, along with getting a new instance of it with "getSupportActionBar()" I am trying to ...
Solder Smoker's user avatar
11 votes
2 answers
2k views

openOptionsMenu() will not work in appcompat-v7 22.1.0 or newer

I've seen several reports of issues where openOptionsMenu() will not work on various Android versions, eg: openOptionsMenu() across android versions openOptionsMenu() not working but the issue I ...
Steve Moseley's user avatar
10 votes
2 answers
17k views

Cannot resolve method setHasOptionsMenu in android Activity

I try to used setHasOptionsMenu(true); in my activity but i get an error. "cannot resolve method setHasOptionsMenu". @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(...
byteC0de's user avatar
  • 5,233
9 votes
4 answers
9k views

MenuPopupHelper cannot be used without an anchor

I want add PopupMenu to my MenuItem. Menu.xml <?xml version="1.0" encoding="utf-8"?> <menu xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android....
Artem's user avatar
  • 4,599
9 votes
5 answers
9k views

java.lang.illegalstateexception: a factory has already been set on this layoutinflater

I have tried to change the background color of options menu in my android app. I am using ActionBarSherlock library. I have tried this code for changing the background color of options menu https://...
samvijay's user avatar
  • 197
9 votes
1 answer
46k views

TKinter OptionMenu: How to get the selected choice?

I am quite new at Python and Tkinter, but I have to create a simple form which requires the use of drop-down menus. I was trying to do something like this: #!/usr/bin python import sys from Tkinter ...
Jackkilby's user avatar
  • 162
9 votes
4 answers
6k views

Best practices for implementing a multi-level Option Menu on Android?

I'm currently working on a port of an iPhone app into an Android. The iPhone app has a custom global navigation menu at the bottom of the screen, and when bringing this over to Android, it was ...
Madhu's user avatar
  • 2,394
9 votes
2 answers
3k views

Option Menu Animation

How can i give a slide down animation like this : <set xmlns:android="http://schemas.android.com/apk/res/android" > <translate android:duration="1000" android:fromYDelta="...
Mohammad Tazehkar's user avatar
9 votes
2 answers
3k views

"Scope Highlight" feature in Visual Studio? (same as seen in BlueJ for java)

I would like to know (as I've failed so far in finding such a feature in the VS's options), if there is a feature which allow for scope highlighting same as seen in the BlueJ IDE for java, here is an ...
SwiftHands's user avatar
9 votes
2 answers
6k views

What is the difference between Option Menu and Panel Menu in Android?

I just created a Panel Menu by mistake with the auto-completion of Eclipse and did not realise it before I read my code. As I wanted to have an option menu, I didn't see the slight difference in the ...
Sephy's user avatar
  • 50.3k
9 votes
1 answer
2k views

Clicking on a menu item in action bar with Espresso when using onView(withId(...))

I am making a test using Espresso, first I open the action bar: openActionBarOverflowOrOptionsMenu(getInstrumentation().getTargetContext()); Everything ok up to here, but then I want to click on an ...
Romina Liuzzi's user avatar
8 votes
2 answers
10k views

"No keyboard for id 0" - what does it mean?

Each time my Optionsmenu opens (onCreateOptionsMenu(..) is called), I get these warnings: "No keyboard for id 0" and "Using default keyMap: /system/usr/keychars/qwerty.kcm.bin" I couldn't ...
cody's user avatar
  • 6,609
8 votes
1 answer
6k views

Tkinter OptionMenu DisplayOptions and Assignment Values

In Python's Tkinter OptionMenu, is it possible to have a list of display options, but on selection, it sets a value to be some other value? Suppose I had variable = tk.IntVar(master) OptionMenu(...
Murphy4's user avatar
  • 1,531
8 votes
2 answers
288 views

Why ActionbarSharelock shows only overflow icon even there are room

I am stuck with Menu item visibility in ABS even there are room in header. Thing is I have test in different size of device but in each case i am able to see only one and that is Overflow menu. I am ...
Chintan Khetiya's user avatar
8 votes
1 answer
4k views

options menu - removing focus from item

how do I remove focus from options menu item? I.e. when I open the menu for the first time, none of the items has focus. however, if I focus on one of them using track ball, and then close and re-open ...
Asahi's user avatar
  • 13.5k
7 votes
1 answer
13k views

how to attatch scrollbar to dropdown list in tkinter?

from Tkinter import * master = Tk() variable = StringVar(master) variable.set("one") # default value w = OptionMenu(master, variable, "Carrier 19EX 4667kW/6.16COP/Vanes", "Carrier 19EX 4997kW/6....
Manikanta P's user avatar
  • 2,877
7 votes
2 answers
3k views

Change text color of option menu when we use app:showAsAction="always"

I am using toolbar and use option for corresponding actions. My problem is this I want to show "SAVE" text on toolbar with white color, I apply many styles but it always appear as black. But when ...
Amarjit's user avatar
  • 4,347
7 votes
3 answers
8k views

Android: OptionMenu between Activity and Fragments

In my app I have one Activity that hosts two Fragments. If I add a MenuItem to the Menu can I retrive it in my fragments? What's the link between OptionMenu in Activity and OptionMenu in his child ...
TheModularMind's user avatar
7 votes
1 answer
543 views

Open OptionsMenu of Activity leaks window on device rotation

Trying to understand what cause the window leak in my Activity. The activity extends AppCompatActivity. It has a single view with a RecyclerView and a ProgressBar invisible while rotating. @Override ...
Ossen's user avatar
  • 129
6 votes
3 answers
5k views

Avoiding Tkinter OptionMenu button resizing

I've the following OptionMenu: self.textoprioridad = Label(self.frameTwo, text = "Prioridad: ", justify="center") self.textoprioridad.grid(row=n, column=4) var2 = StringVar() menu2 = OptionMenu(self....
Avión's user avatar
  • 8,236
6 votes
6 answers
17k views

Python Tkinter: OptionMenu modify dropdown list width

I have created an OptionMenu from Tkinter with a columnspan of 2. However, the dropdown list/menu does not match the width, so it does not look good. Any idea on how to match their width? self....
James the Great's user avatar
6 votes
1 answer
2k views

Intellij maven options - What are differences between them

Im a bit confused with maven options in intellij. What are the differences between and when would you use them? Reimport Generate Sources and Update Folders Download Sources Download Documentation
Robbo_UK's user avatar
  • 11.8k
6 votes
1 answer
897 views

Click on menu-item that is sometimes in the overflow-menu

currently to click on menu-item that is sometimes on some devices in the overflow-menu I am doing the following: fun invokeMenu(@IdRes menuId: Int, @StringRes menuStringRes: Int) { try { onView(...
ligi's user avatar
  • 39.2k
6 votes
1 answer
10k views

WebView Back, Refresh, Forward? Simply doesn't work!

I have tried everything to get my 'forward' and 'back' to work. Refresh is working [I figured it out by changing the method to read 'webView.reload();' instead of 'webView.refresh();' Can anyone ...
Kazuko Ando's user avatar
6 votes
3 answers
2k views

Fragment Option Menu Avoid Showing One Fragment Menu In another

I am Replacing 2 Fragments One After another, and both fragments have different option menus. When I replace 2nd fragment it is showing menus of 1st fragment also. setHasOptionMenu(true); has set in ...
Jogendra Gouda's user avatar

1
2 3 4 5
12