Questions tagged [spinner]

1

votes
2

answer
195

Views

Restoring State of Spinners and Their Adapters

I am having issues trying to restore state of Android Spinners in my application. Currently there are multiple Spinners in my Activity's ListView header that depend on one another, as the selection of one Spinner loads data for the subsequent Spinner. The problem I am experiencing is, restoring stat...
JPM
1

votes
2

answer
146

Views

Populate first spinner on the basis of second spinner

I want my page to have two spinners and want to populate the second spinner on the basis of selection of the first spinner . I took two arrays . The first array is or the 1st spinner and the three arrays are for the second spinner . On the value selected from the first spinner I want the second spin...
1

votes
1

answer
147

Views

How to show specific data in spinner with Firebase?

My data is being retrieved, but I only want to display the names in my spinner like URL_xxx_NB or URL_xxx_FR, because I'm storing different URLs when people use the app in another language, and I need to retrieve only the names and when I put datasnapshot.getvalue() it brings me the whole thing, nam...
Gastón Saillén
1

votes
3

answer
98

Views

How to validate empty text in spinners

For my spinner I have a hidden text and a validation code to display error message if spinner is skipped. While the code works if the spinner is not selected, the error message gets displayed all the time even if I have selected an option in spinner. final int pos = spinner5.getSelectedItemPosition(...
Padma Kotish
1

votes
1

answer
984

Views

Custom spinner android

Question: When setting adapter it hides its custom background I am trying to add custom background to spinner like this, my custom drawable is, Setting adapter like this spinnerReferredBy.adapter = ArrayAdapter(activity,R.layout.custom_spinner_item,referred) Outputs without setting adapter With adap...
Pramod Waghmare
1

votes
1

answer
102

Views

Marquee is not working in spinner custom text xml

here is my layout_item.xml : android:id='@+id/txt' android:layout_width='match_parent' android:layout_height='wrap_content' android:padding='8dp' android:gravity='left' android:background='@drawable/spinner_line_box' android:text='janak' android:ellipsize='marquee' android:marqueeRepeatLimit='marque...
Janku
1

votes
2

answer
293

Views

How to change drawable shape color based on spinner selection

I am trying to figure out how to change the solid color and the stroke color based on the spinner selection. spin_shape drawable Button with the drawable as a background Array resource xml file #ff0000 #e9b300 #db9fd5 #2988BC #660006 #0C6674 Here's what I used to change an image view based...
n.gause
1

votes
0

answer
242

Views

Spinner dialog background color

I know this question will be a duplicate but , even after going through many suggestions, I still couldn't change the dropdown style for popup diolouge of a spinner. Below is my Spinner xml - You see, I already made popup background color as ff0000 and its still not reflecting so please dont give t...
Pradeep Kumar
1

votes
0

answer
42

Views

How to get my Spinner to show String value from my Integer Array list?

I had to create a spinner with each item a different color. I managed to accomplish this but now instead of the text value showing up with the color that is shown, it's just showing up as blank. I've tried using the txv.setText() but this is not what I want. I want it to use my array list values,...
pyuntae
1

votes
1

answer
56

Views

How to wrap long text in spinner items in codenameone?

In below image item names are getting clipped off. so i want to display spinner items in multi lines in codenameone. for that I have created custom picker and changed extension from Button to SpanButton and it is effecting to selected item but not drop down item. how can i resolve this?
tyson
1

votes
1

answer
269

Views

Android Studio Stopping/Killing Timer with Switch Statement

What I've built is a timer with multiple timer styles, using a spinner so the user can switch quickly between the timer they want to use. My problem is with the switch statement - each timer works fine on its own but when going (example) from the Basic Timer to the Countdown Timer via the spinner,...
rsoderberg
1

votes
0

answer
219

Views

Can only update a mounted or mounting component. This usually means you called setState, replaceState, or forceUpdate on an unmounted component

Homepage.js import React, { Component } from 'react'; import { Route, Redirect, withRouter } from 'react-router-dom'; import $ from 'jquery'; import { css } from 'glamor'; import { ToastContainer } from 'react-toastify'; import toast from '../toast'; import { BarLoader } from 'react-spinners'; // -...
Sushmit
1

votes
2

answer
50

Views

Trying to set the current selection of a spinner using a string instead of an index

I would like to set the selection of a spinner using a string instad of an index. So if I have spinner of red, green and blue, I could set the current selection to blue by using the string 'blue' instad of the index 2. How this can be achieved?
Ted pottel
1

votes
0

answer
163

Views

Android: Model bound Spinner resets to first value in its entry list

I use Androids binding to populate my Spinner and set the selected item in the model. This works fine so far. But when I load a model with previously set Spinner value it gets always set to the first item in the Spinners list. This is the Spinners excerpt from the layout file: And the conversion met...
Niels
1

votes
0

answer
47

Views

How do I populate 3 spinners in a fragment and get selected item in text view?

The 2nd spinner is based on the 1st spinner and the 3rd spinner based on the 2nd spinner. Here I tried but it seems whenever I select the second item, it resets and the 1st item is selected. I am unable to select other options only the first one is selected through out the output. This code is not w...
Nikhil Satalkar
1

votes
0

answer
66

Views

Spinner not displaying Emails

final Spinner emailsList = (Spinner) findViewById(R.id.email_list); ArrayAdapter adapter = new ArrayAdapter(this, android.R.layout.simple_dropdown_item_1line, getUserEmails()); emailsList.setAdapter(adapter); public ArrayList getUserEmails() { AccountManager manager = AccountManager.get(this); Acco...
Qamran Rajput
1

votes
0

answer
83

Views

SetSelection is not working in android spinner

I am developing an android filter where I am using multiple spinners, the problem is that when I used to setSelection option it is not showing me correct position. But when I use the same functionality within the button click it shows me right selection. I want to know how can I set selection posit...
Abdul Fatah
1

votes
3

answer
285

Views

How to set background of MaterialBetterSpinner in android?

This is my Design of campaign_create.xml Spinner : @drawable/rounded_white.xml I want to set background of spinner. It is drawable file. i set property android:background='@drawable/rounded_white' but it didn't work. How to set background of spinner?
Unnati Patadia
1

votes
1

answer
42

Views

Keep Android Spinner from dropping list

I have an Android spinner that I would like to disable when there's less than one item in my list. What I mean by that is I would like the title to show up, but I don't want a list to drop down when I click it. I've tried isClickable = false, and isEnabled = false like in many of the posts out there...
Rafa
1

votes
1

answer
59

Views

ListView inside / with spinner

Experts,I been struggling to solve the below issue. Have got code which basically searching the data using edittext to spinner which is working fine. But issue is i am unable to open the spinner to see the inside contents.Used AdapterView.OnItemSelectedListener but no use. Your most welcome to modif...
Leace
1

votes
0

answer
33

Views

Unable to select items from the Spinner in Android Studio

I am new to Android Studio, so I don't know much about the functions. I am using a spinner which allows me to choose from different languages. In my MainActivity class, I have the following code: String lang='eng'; dropdown.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() { publi...
Hars
1

votes
1

answer
66

Views

How to get data from spinner

I need to get the data from a spinner and myCalendar activities how to get data from it and main activity to be able to process data and input it as email?
Kelvin
1

votes
2

answer
33

Views

set one spinner to empty value when other one is clicked

I have two spinners, the first one shows the transport lines and the second one shows the stations of the line selected on the first spinner, the problem is that I want to set to empty value the second spinner when I click on the first one, but I can't do it. private ArrayAdapter arrayAdapter; priv...
DavidZam
1

votes
1

answer
382

Views

Android: show hint in spinner before clicking any item

My program is on designing a spinner with hint word 'Introduction' before clicking the arrow of the spinner to select items, as I click the arrow, it will appear a drop-down menu with several items, but I don't want the hint word to appear as one of the items in the drop-down menu. And as I click on...
tivia
1

votes
2

answer
47

Views

Appearance issue in spinners in Android studio

I put two spinners in the same activity, one for City and the other for Town. When the user chooses a City, the Town spinner should populate with items according to the City that was chosen. My problem is, the color of the background and the text is always different from the first one, however they...
Wessam Alkumait
1

votes
1

answer
127

Views

jQuery UI spinner - suffix & prefix

I have seen that it is possible to add a suffix to the jQuery UI spinner with the help of the widget functionality. Now, I was trying to add a prefix, too. This failed and I cannot figure out why. The error thrown is: Uncaught TypeError: value.substring is not a function for the prefix. I am using...
Harald Wirth
1

votes
2

answer
563

Views

Playing multiple audios simultaneously with MediaPlayer

I got a problem with playing two MediaPlayers simultaneously. In my code I made a spinner to let the user to choose his first song and then the second song, at the moment that the user chooses the first song it starts to play and when the user choose the second song it will play with the first one....
mike23
1

votes
1

answer
1.8k

Views

Android Kotlin - How to set Spinner selected item

I have a spinner populated with array of strings from XML: When user selects something, I save it to SharedPreferences. How do I set the value back when the app is opened next time? I have only the value saved, not its position in spinner's list.´ If I just do spinner.Units.adapter to get the adap...
Destabilizator
1

votes
0

answer
83

Views

rotate spinner arrow android

i am trying to rotate spinner arrow when spinner click. i try different solution but not get exact result. i want that rotate arrow from up to down when it select. this is my xml code for spinner. this is in activity. ss=(Spinner)findViewById(R.id.pricespinner); ArrayAdapter spinnerArrayAdapter = n...
1

votes
0

answer
32

Views

Disable spinner from moving to last selected item on dropdown

I have a spinner where I am adding hint at the bottom(not adding to top as getSelectedItemPosition will consider the hint as well) using arrayadapter hiding it from showing on dropdown options. The problem I am facing is, if I make the hint to show for the first time by using setSelection, then drop...
User007
1

votes
1

answer
29

Views

java.lang.IllegalStateException in ScrollView when rotating device

I'm using a ScrollView, called fragmentView below, to host a custom Fragment inside of it, and it generally works fine. However, when I rotate my device into landscape mode and back, the app crashes saying java.lang.IllegalStateException: ScrollView can host only one direct child I add the Fragment...
Cohn Jena
1

votes
1

answer
33

Views

Android - Unable to pass Spinner value to jsonSendRequest

I'm new to Android development and Java in general, so I was wondering if someone could point me in the right direction. I'm writing a currency convertor app and using Volley requests to send a request to an API to retrieve conversion rates. Right now I am hardcoding the countries into the URL, whi...
Rubiks H
1

votes
1

answer
314

Views

Set Spinner selected item by value - casting SpinnerAdapter to ArrayAdapter?

I have a Spinner which is populated by array from strings.xml, user sets it to something, I save it to preferences - I'd like to save the string as I print it in several places further, instead of the position. Now when the user comes back, I want to set the Spinner to previously selected value. If...
Destabilizator
1

votes
0

answer
68

Views

Add second Database Spinner and display it in a TextView

I wanna make an app where you can add a fore name and surname via the firebase database. With a button you can add the first name, it is stored in the database and with the spinner you can select it. code: public class MainActivity extends AppCompatActivity implements NavigationView.OnNavigationIt...
Hansi
1

votes
0

answer
152

Views

Unable to set height for Android Spinner popup in API 21 and 22

Herewith I used 'spinner' with some styles. To set height of the spinner popup, I used 'List Popup Window'. It's working fine for more Android versions. But API 21 and 22 (Android 5.0 and 5.1) not supported. Below is my code that I found from How to limit the height of Spinner drop down view in Andr...
Nuwan Withanage
1

votes
0

answer
32

Views

Extracting Data from a Spinner and showing it on a new Activity

I have been working on this project for a while and I can't get all of my data to show on the next page in activity. I have 12 spinners on one page and I need all of there data to show up in 12 different textviews on the next Activity page. I have it so that it uses a button to move from page to pag...
Roni Skinner
1

votes
1

answer
198

Views

How to get value from a spinner type control with Selenium

In mobile app(android), we have a Date control of class android.widget.spinner type. After selecting the value from this control, I tried to get the value using selenium code driver.findElement(By.xpath('//*[@resource-id='dttDate']'))).getText(); But the above code giving blank value. Can some one h...
SeJaPy
1

votes
0

answer
63

Views

Spinner not showing on device but is on emulators

My initial 'home' activity in my android App has a spinner populated from a database. On the emulator this works absolutely fine. When I have my phone connected to the computer and run the app it also works fine. However, when it runs on my phone standalone (i.e. without being connected to Android S...
Joco
1

votes
2

answer
52

Views

Spinner not saving the last selected value

I have a spinner in my android application and the spinner goes to the first item whenever I go to other fragment and come back. All I want is that the spinner should retain the value. Below is how I setup the spinner. private void setupSpinner(){ roundSpinnerMap = new HashMap(); roundSpinnerItems...
M.Shaikh
1

votes
2

answer
151

Views

onItemSelected doesn't work

I m having problems working with Spinner. I have a custom adapter for the Spinner. This is the code : public class CategoriaArrayAdapter extends ArrayAdapter { private Context context; private ArrayList values; public CategoriaArrayAdapter(Context context, int textViewResourceId, ArrayList values) {...
Coeus

View additional questions