Android Interface definition for AdapterView for a callback to be invoked when an item in this view has been selected.
Questions tagged [onitemselectedlistener]
119 questions
10
votes
1 answer
Implementing events Spinner with Butter Knife
First: We need to reference the spinner
@Bind(R.id.field_type_id)
Spinner mTypeIdSpinner;
Second: Create string array
- One
- Two
- Three
- Four
…
![](../../users/profiles/3232778.webp)
yaircarreno
- 3,367
- 30
- 29
6
votes
2 answers
AdapterView.OnItemSelectedListener is returning NULL view
I have the following code :
public class OnboardingActivity extends BaseLoggedInActivity
implements CountryPickerDialog.ICountryPickerDialogUsers, AdapterView.OnItemSelectedListener {
private Spinner _countryCodeSpinner;
.
.
.
private void…
![](../../users/profiles/4299766.webp)
rohit sharma
- 125
- 1
- 9
3
votes
0 answers
ArrayAdapter OnItemSelectedListener does not work
I created an arrayAdapter to show items in the MaterialDropdownMenu and i want the TextView to set the text to the item selected, but the text never changes. Why doesen´t it do that?
Thanks
Here the Kotlin file:
val options = arrayOf("Item 1",…
![](../../users/profiles/15068386.webp)
F72B
- 31
- 1
3
votes
1 answer
Fragment spinner onItemSelected method never called
I'm having difficulties on implementing a spinner OnItemSelected method using fragments.
I have an Activity which manages two fragments. the only one relevent is the home frag.
I'm implementing the AdapterView.OnItemSelectedListener and overriding…
![](../../users/profiles/11992666.webp)
Or Bitton
- 31
- 3
3
votes
2 answers
Avoid Spinner's onItemSelected being called automatically after setAdapter
The Spinner is calling onItemSelected automatically after setting adapter, and I'd like to avoid it without any kind of workaround such as using flags to check if it's the first time; add the listener after setting adapter or any verification like…
![](../../users/profiles/1132033.webp)
Lennon Spirlandelli
- 2,831
- 5
- 22
- 50
3
votes
2 answers
Android Spinner OnItemSelected ONLY on User Interaction
I know that this question has been answered multiple times, but I have not found any of them satisfactory and certainly not elegant.
The issue is that OnItemSelected gets fired not only when the user selects an item, but also when the selection is…
![](../../users/profiles/1839307.webp)
NewEndian
- 399
- 1
- 12
3
votes
1 answer
Scale Animation for listItem
I have a ListView. I know how to highlight or change the background of a selected item in a ListView.
But I want to scale the selected item like this:
(selected item is a little bigger than other list items in this picture)
Can anyone help me to…
![](../../users/profiles/2101822.webp)
Milad Faridnia
- 8,038
- 13
- 63
- 69
2
votes
2 answers
Problem with onItemSelected spinner in android
I want to change language of my app by selected spinner, but at first time, don't change. After two time selected, it worked. I force to use setOnTouchListener because without it occur loop. It worked but after many times select.
This is my code:
…
![](../../users/profiles/12078052.webp)
zahrahoseini
- 19
- 4
2
votes
2 answers
Android - How to Disable Specific Item for Multiple Spinner in One Activity
I have three spinners in one activity. How to disable an item selected from each spinners to the respective spinner?
I have set the data in string array in strings.xml:
- American Restaurant
…
![](../../users/profiles/12168366.webp)
Ahmad Hazman
- 25
- 4
2
votes
1 answer
OnItemSelectedListener in Dialog
I have a spinner in a dialog and I am trying to get the value from the selected item in spinner and pass it to a String variable. The method that I have found was spinner.setOnItemSelectedListener().
However, this method requires another method to…
![](../../users/profiles/11160651.webp)
Tan YiLiang
- 27
- 2
2
votes
1 answer
Update recyclerview single row data when spinner item data is changed
I have a RecyclerView as given in picture below.
I get the food item data from the server and bind them to RecyclerView as above.
Food items are assigned in foodItemList array list which has foodItemTypeList array. In foodItemTypeList array list,…
![](../../users/profiles/3529709.webp)
danishjo
- 159
- 1
- 7
2
votes
2 answers
Best way to implement ArrayList in Android Studio
i have 30 items in ArrayList and its implement in Spinner, i placed it in java file like this
ArrayList listProblemSolving = new ArrayList<>();
listProblemSolving.add("List1");
listProblemSolving.add("List2");
…
![](../../users/profiles/2552275.webp)
MNFS
- 175
- 3
- 16
2
votes
1 answer
android spinner adapter OnItemSelectedListener what is Row Id
I am working with spinner in android for a while now, and I always use what it says in documentation and I would use parent.getItemAtPosition(pos) to get the Item, or I would use questions like this but the question is: docs say the
id in…
![](../../users/profiles/4257442.webp)
Pouya Danesh
- 1,323
- 2
- 16
- 32
2
votes
2 answers
How to set the text of a TextView to the content of a selected item on a spinner?
I'm trying to get the value of the selected item into a TextView, and i want it to change each time the selected item change!
I've try to get the position of the selected item into a string then set the text of the TextView equal to this same string…
![](../../users/profiles/7585957.webp)
Ben Brcl
- 23
- 4
2
votes
1 answer
Spinner AdapterView.OnItemSelectedListener not working
I'm using two way data binding on an edit activity, I'm trying to avoid boilerplating and I need to know when the data changed on that activity. I have created a TextWatcher for EditText that works perfectly. Now I want to do the same thing with a…
![](../../users/profiles/7101350.webp)
mmarin1m
- 31
- 3