FAQ Database Discussion Community


SetEnabled(true) in Popup Menu items is not working

android,spinner,popupmenu
In my app I have a spinner that the user fills it with phone numbers. The user have 3 options : Add - Edit - Delete. For displaying the options i used popupMenu. So, in the beginnging when the spinner in empty, the options Edit & Delete are enabled (defined...

How to change spinner selection value by scrolling listview in android

android,listview,spinner
I want to change the value selection of a spinner when a listview is scroll by user. I have no idea how to do this any example would be a great help. The spinner has list of item such as 1 2 3 4 5 6 7 8 9 10......

How to retain the selected item in spinner? [closed]

java,android,spinner
I am now learning android. I am working on an application, where in when i click on a value of Spinner it moves to the next Intent. And then when I come back to the old (first intent), i need to retain the selected item in that spinner. Please help...

Swift spinner/picker isn't holding or showing integers

ios,swift,spinner,picker
I'm trying to figure out why my spinner won't hold integers. When I run the program, question marks appear in the spinner instead of 1,2,3,4 and so on all the way up to 100. I'm new to Swift and this is my very first time working with the spinner/Picker. My...

Showing spinner items according to previous one

android,spinner
I have 2 spinner in my app. And i want to showing spinner item according to previous spinner's selected item. I get the selected item of first one in onItemSelected method. But i can't use it for making list of another one. How can I do this? I want to...

why this runtime is occured :Unable to instantiate activity ComponentInfo?

android,spinner,runtimeexception
when I try to define an spinner, this Run time exception is thrown. Why?

How Can I Add A Spinner Dynamically(By Press Of A Button)?

java,android,spinner
I am new to Android Programming, I have been trying to add a spinner with a button click, my wonder is i always keep getting an error, I can not find a solid answer anywhere, Can somebody please help me? below is my code it tells me inSpinner cannot be...

Is it possible to use an expandablelistview as a dropdownview for a spinner with multiple select?

android,spinner,expandablelistview
I am using a Button plus an AlertDialog containing an ExpandableListView. Also put a checkbox along with child row, its working fine for single select, but its not waiting for multiple select. When I am using for multiple select, I have to click outside the dialog to terminate the dialog....

How to get selected text using android spinner wheel?

java,android,spinner,wheel
I am using Android Spinner Wheel and I already set code for that. AbstractWheel wheelHorizontalView1 = (AbstractWheel) findViewById(R.id.wheelHorizontalView1); NumericWheelAdapter minAdapter = new NumericWheelAdapter(this, 1, 15,"%01d"); minAdapter.setItemResource(R.layout.wheel_text_centered_dark_back); minAdapter.setItemTextResource(R.id.text); wheelHorizontalView1.setViewAdapter(minAdapter); Here is how it looks like: So, my question is how to get 3 as my selected text ? Here is xml...

Getting data from a Spinner (Android Studio)

android,spinner
I'm trying to get the data from three spinners, ready to POST it. I'm having trouble with a load of errors with my code that I don't understand...I'm new to Java/Android. I've looked around and the code I'm using comes from another Stackoverflow answer but it does work: //Spinner data...

Angular-spinner: functions execution order

javascript,angularjs,spinner
I am pretty new to development and particularly to AngularJS. I have a few slow functions in my app and I would like to show a spinner while the functions are running. I found Angular-Spinner which should work fine. I created a div <div ng-show="spinner" class="results_overlay ng-cloak"> <span us-spinner="{radius:30, width:8,...

How do I get a value from a selected Spinner item that loads a ListPreference?

android,button,spinner,listpreference
So this is my situation... I have a Spinner with Parking Zones... Zone 1, Zone 2 etc. What I want to do: when user clicks a Button "Send SMS Message", the Button should load a Parking Zone phone number into an SMS message. The Parking Zone number is set depending...

Checking if spinner is selected and having null value in Android

android,spinner
I want to check first if spinner has null values based on the following: String Name= spinnerName.getSelectedItem().toString(); if(Name != null) { } else { } is this a proper way? because i get FATAL EXCEPTION: main java.lang.NullPointerException on String Name= spinnerName.getSelectedItem().toString(); I have declared it on Create...

how to get associated other json value in spinner when an item selected

android,json,spinner,android-spinner
I am trying a simple app where I populating a spinner with the values (json value) I got from network call. But I am not getting how to get the associated json value, when an item selected from the spinner. Can any one provide me a article/reference on how to...

How to select an item in a spinner using a button

android,button,spinner
I created a spinner with 5 items and I also created 5 buttons. What I want to do is to associate a button to an item in the spinner. So when I click a button, a corresponding item will be selected. For example: I have 5 items in my spinner:...

Spinner throws NullPointerException when calling an entries value

java,android,spinner
I have a Spinner in my ActionBar, I want to get the value of the entries in the Spinner when I pick one and convert it to String. It is thorwing NullPointerException every time I start the Activity. How do I fix this? I have read many guides and stackoverflow...

Spinner does not select item

android,android-fragments,android-studio,spinner,android-arrayadapter
I've been on this for a very long time and I can't get it to work... I have a spinner that is populated by a list of dates in my class that extends Fragment. However, when I select one of the dates from the dropdown spinner nothing happens. It should...

Using a Spinner to Change webView

android,webview,onclick,spinner
I have an app that sends a user input to a website's search URL, like so: To do this, I was wondering: How do I store the last webpage visited on each site to cache? How should I add the website names to the spinner? How would I write the...

How to enabled up/down keys in a JavaFX Spinner component

java,spinner,javafx-8
I'm using a Spinner component in my JavaFX application. It's created via FXML: <Spinner fx:id="spinner" editable="true" min="0" max="100" initialValue="3" /> According to the documentation of Spinner: The keyboard up/down arrow keys also cycle through the elements. However, when I click in the spinner component and press UP or DOWN only...

Save Spinner with SharedPreferences in fragment (OnItemSelectedListener)

android,fragment,sharedpreferences,spinner,onitemselectedlistener
I am new to Android programming and at the moment I am trying to make some spinners with four array elements (string-array), and then save the current state with shared preferences. I've already done a lot of research, but most of the solutions only work for activities, and I am...

Something is crashing my app after I implemented Spinner setOnItemSelectedListener

android,crash,textview,spinner
Just to clarify first, I'm a newbie with Java and Android, and I'm still in a heavy learning process. Anyway... I'm working on a simple Parking SMS app, and I'm stuck with Spinner and a TextView. Basically, I'm trying to do this: when I select a Parking zone from a...

Python 2.5 Tkinter Highlight Spinbox Entry

python,tkinter,spinner,entry
This question seems trivial to me but I can't seem to find anything related to it, and the Spinbox docs don't seem to help. Is there any way to select all of the text in a Spinbox widget? I'm currently trying: self.spinbox.selection_clear() self.spinbox.selection('range', 0, END) to no avail. I have...

List obtained from Parse.com to an Android Spinner

java,android,arrays,parse.com,spinner
I'm trying to get an array list from parse.com and insert it into a Spinner to have more control of my app. I've seen how to add things via code to a Spinner, but I've not been able to retrieve a list from Parse and put it into the spinner....

How to send spinner value to server using JSON in Android? [SOLVED]

android,json,string,spinner,value
I am new on Android. I am not able to send spinner value to jsonobject. I am getting an error: "selected cannot be resolved to a variable". Following is my code. Please tell me what I need to do. Thanks in advance. public class SignupActivity extends Activity implements OnItemSelectedListener {...

Cannot populate Spinner from SQLite DB

android,sqlite,spinner
I've went through a couple tutorials, trying to populate a spinner from a local SQLite database. I have made a class that successfully inserts items into the database but when I try to populate the spinner, it seems to fail when I try to attach the data to the spinner...

How can I generate a video from raw folder based on spinner selection?

android,arrays,object,video,spinner
I was wondering if there was a way I can generate a video to play that's within a raw folder which is dependent on what is selected from two spinner drop-down menus? I'm trying to make a video navigation app for my school that asks the user to select a...

Element spinner must be declared

android,layout,spinner
I'm trying to add Spinner to ActionBar and getting this error right in xml file: Element spinner must be declared I'm confused. The problem solution must be simple but I can't really realize how to solve it.. ...

Issue with android spinners - Loading distinct values in spinners

android,spinner,distinct
I'm using two Spinners to show the items I'm getting from the json response. I have 2 problems right now. When u check my logcat u can see there are items repeating (Right side list, u can see so many pan). I want to have 1 item only once in...

Create a calculator from a spinner

java,android,spinner,calculator
I have created two spinners where the user can select a Meal Type and then select a food, (e.g. 'Breakfast' and 'Porridge'). I then need to times the food calories by the weight the user enters in an Edit Text but I am not sure how I do this. How...

Android:How To set set deafult value of Spinner?

android,spinner,android-spinner
I am creating a Dropdown(spinner) in which all days have to shown,but i want to set different Default value.Presently default and first value of spinner are same..Please help me how to do this...Code snippets are appreciated.... My is => public class MainActivity extends Activity implements AdapterView.OnItemSelectedListener { Spinner spinner; @Override...

Getting a null pointer on android spinner

android,nullpointerexception,spinner
I'm trying to implement the spinner into the action bar, however I'm getting a null pointer reference when I try to set the adapter. I don't know what the problem is because it was working fine when I set it previously in the activity. This is my code @Override public...

How can I fix the spinner widget at the top of the page in adroid?

android,android-layout,spinner
I am using a spinner for drop down in my android app. But, problem is when user scrolls down, the spinner moves up and becomes invisible. I want to fix the spinner at the top of the page so that user can easily select the page. Here with Scrollbar: On...

Spinner Error “Spinner adapter view type count must be 1”

android,parse.com,spinner,illegalargumentexception,android-parsequeryadapter
I am using Parse.com in my application when I use ParseQueryAdapter in fragment to retrieve data and pass to a spinner an error as java.lang.IllegalArgumentException: Spinner adapter view type count must be 1 and application stops. However if I try ArrayAdapter it works. What could be the problem? ParseQueryAdapter Code:...

android get an integer from a spinner similar to that of the method used for strings

java,android,xml,integer,spinner
In two parts of my app I have spinners. One spinner provides a set of strings, and the one I'm currently working on is supposed to allow the user to select a preset number (10, 25, 50, 100) of questions to take a practice test with that many questions. I...

android: add unique tag or id for spinner view

android,spinner,android-spinner
I create 4 spinner views in my application, when I change the selected item on one of them I want to know which one of spinners is selected and changed. I use this code : for(int i=0;i<4;i++){ final Spinner spinner= new Spinner(context); ArrayAdapter<String> spinnerArrayAdapter = new ArrayAdapter<String>(context, android.R.layout.simple_spinner_dropdown_item, spinnerArray); spinner.setAdapter(spinnerArrayAdapter);...

Get value part from spinner not text part in android

android,spinner
I have a spinner and I bind it to the list of objects with each object containing text and id part.Text part is displayed to the user and user can select any item from the spinner. Now my question is that How can I get value part from the spinner....

How do I associate numbers with my array list?

java,android,arraylist,spinner,calculator
I have created two spinners, a meal type spinner (e.g. Breakfast, lunch...) and a food spinner (e.g. porridge). Once the user has selected their meal type the associated foods appear in the second spinner. Now I want to be able to create a food calculator which will multiply a set...

Customize the spinner in Android is giving space issue

android,spinner,relativelayout,android-spinner
I have customize the background of the spinner. I have removed the background and showing a spinner down arrow beside that. But if the text are not properly aligned. The bigger length text is showing in complete area but for smaller text, there is a gap coming for text and...

Android: Spinner setPadding not work

android,spinner
I use this code for set padding to spinner ( not for children ) Spinner spnCategory = (Spinner) findViewById(R.id.spnCategory); List<String> list = new ArrayList<String>(); list.add("UP"); list.add("Down"); ArrayAdapter<String> dataAdapter = new ArrayAdapter<String>(this, android.R.layout.simple_spinner_item, list); dataAdapter.setDropDownViewResource(R.layout.dropdown_item); spnCategory.setPadding(15, 5, 2, 4); spnCategory.setAdapter(dataAdapter); But this code not work...

Android - Remove Spinner Dropdown Arrow

android,android-layout,spinner,android-spinner,android-selector
I'm just wondering if it's at all possible to simply remove the dropdown arrow for a spinner? I have a drawable arrow in a backgroud layout for my spinner, however the system default arrow appears to the right of the spinner, which I would like to get rid of. Here...

Android Spinner, selector icon location

android,spinner,styling
I wonder if (and how) it's possible to change the icon location of the Spinner's selector icon. At this point I've got my spinner's width matching the parent (full screen) and then got the text centered. So at this moment, the text is centered but the selector icon is at...

Spinner not displaying entries

java,android,arrays,spinner
I have two spinners, one where the user selects the food type and a second that is meant to display the food (e.g. Breakfast and Porridge). However my second spinner isn't displaying my foods. Why would this appear? Below is my MainActivity class and my Food class code. private void...

Set default selection for a spinner

android,spinner,android-spinner
I know this is probably a relativity simple question, but I seem to be overlooking the answer. In my app, I have a spinner for the user to select the state that they live in. Currently, the app will be focusing on a local audience so I would like to...

Polymer+Firebase Element - Show spinner while updating data

firebase,spinner,polymer
I'm trying to learn Polymer, but I have some questions and can't find the solutions anywhere. I want to put a loading spinner in my app, while the data is being retrieved from firebase (using firebase-element) to fill the screen info. How can I detect that all data/elements are already...

Failed to read row 0 column 3730

java,android,cursor,spinner,adapter
This is my code: dbAdapterdepartamento = new DBAdapterDepartamento(new Sqlitebbdd( getApplicationContext())); Cursor cdept=dbAdapterdepartamento.getAllDepartamentos(); cdept.moveToFirst(); while (cdept.isAfterLast() == false) { if (cdept.getFloat(cdept.getColumnIndex("_id")) == 0) { String title = cdept.getString(cdept.getColumnIndex("departamento")); Log.e("",""+title); } cdept.moveToNext(); } cdept.moveToNext(); departamentoSpinnerAdapter = new SimpleCursorAdapter(this, android.R.layout.simple_spinner_dropdown_item, cdept, new...

How to save spinner state for specific item

android,spinner
So I have an android app that organises a list of items. Each item has the same fields. Including one selected by way of spinner. I can save the details of each item individually just fine, and open them and edit them without any problem. However, when ever I change...

Android spinner acting weird on rotate

android,spinner
I have a fragement with various Spinners in it. To have these spinners display an initial (non selectable) value I'm using a custom arrayAdapter (SpinnerHintAdapter). The only important thing this class does is override the getCount() so the last item of the selection-array isn't displayed, this is where the initial...

How to use spinner list in database

android,database,list,sqlite,spinner
Now, i create a spinner list which show in programme and there are several choices. If i want to use an spinner list to select an item then the selected item will add into database by using SQLite code. Also, how to show the selected item in next line after...

Get Specific part of the string of a spinner

android,eclipse,spinner
I have a spinner populated by mysql Database: JSONArray data = new JSONArray(getJSONUrl(url)); final ArrayList<HashMap<String, String>> MyArrList = new ArrayList<HashMap<String, String>>(); HashMap<String, String> map; for(int i = 0; i < data.length(); i++){ JSONObject c = data.getJSONObject(i); map = new HashMap<String, String>(); map.put("customerID", c.getString("id_bus")); map.put("name", c.getString("bus_line")); map.put("phone", c.getString("bus_number")); MyArrList.add(map); } SimpleAdapter...

Spinner Dropdown Arrow

android,android-layout,spinner
I am trying to obtain a custom Spinner such as this one: but I was only able to get this: As you can see I experience several problems. Although I added a custom arrow, I still see the original. My custom arrow gets shown at every row. How do I...

custom spinner with colored dropdown image

android,spinner,android-spinner
I am working with custom spinner. I am struggle on this. How can I get the spinner like this ? Note : I have the red color image....

how to remove error in Spinner in android

android,spinner
If user select Admin from Spinner dropdown menu this activity move to About.class and when user select Teacher from Spinner dropdown menu this activity moves to Student.class but errors occur. Errors come in these lines: spinner.setOnItemSelectedListener(new OnItemSelectedListener() { @Override public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {...

How to change spinner text color in the actionbar

android,xml,android-layout,colors,spinner
in my project I have this custom layout inflated in the actionbar: Link to image But i would like to have the spinner text of white color. I've seen a lot of topics on the web about this, but I can't fix the problem yet. How can I fix this...

How to set Spinner value based on value from database?

android,spinner
I have been looking for an answer to this question and it took me quite some time, but none of the answers I found here was satisfactory. The problem is that I wanted to update a record in a database and I needed to transform the database value to a...

passing the index value of the selected value from the spinner to asynctask

android,android-asynctask,spinner
In the registration process, when the user select the title from the spinner then its array index values should be automatically select and send to the asynctask. I want to send the array index value (position) as well in the below shown code. new RegisterAsyncTask(getApplicationContext()).execute(TitleName,CountryName); original value of the position...

Android Spinner not working on Samsung Devices with Android 5.0

java,android,spinner,android-5.0-lollipop
I'm using a custom Spinner widget with the code below. Everything works fine on most devices except on Samsung's devices with Android 5.0. On click the Spinner should display a list of values but that doesn't happen. On emulators and others brands devices with Android 5.0 it works fine. Has...