spinner

How is it possible to create a spinner with images instead of text?

Given the code bellow, is it possible to have images instead of text in the array planets? Spinner s = (Spinner) findViewById(R.id.spinner); ArrayAdapter adapter = ArrayAdapter.createFromResource( this, R.array.planets, android.R.layout.simple_spinner_item); adapter.setDropDownViewResource(and...

Android Development: Problems With Creating Spinner

Hello, In my app I'm developing, I have a spinner in an alert dialog box. The spinner works fine, but when I added the following lines to add the array to the spinner, my app crashing a few seconds after starting up: ArrayAdapter<CharSequence> adapter = ArrayAdapter.createFromResource(this, R.array.newFileTypeArray, android.R.layo...

How can i use a switch with a spinner ?

Hi everyone, so i started android programming like a month ago, and i've got a probleme today. The thing i want to do is : From a Item in the Spinner, when i select it there is a Text View changing on the back. spin.setAdapter(adapter_city); spin.setOnItemClickListener(this); } @Override public void onItemClick(AdapterView<?> p...

i've got some problems with my spinner..

So i'm starting a application and the first thing to do is make a description of a city when the city is selected. I can show the description but it make the description of all the cities on the same time and it don't come out when i select another city : it add more and more . this is my code : public class Main extends Activity imple...

How to make Spinner Editable in Android?

I changed the ArrayAdapter method of spinner and i got my custom Spinner. just change the parameter of this method like Spinner spinner = (Spinner) findViewById(R.id.Spinner01); ArrayAdapter<CharSequence> adapter=ArrayAdapter.createFromResource(This,R.array.statename,R.layout.mylayout); spinner.setAdapter(adp); In Which the mylay...

Set spinner within custom dialog

I'm getting a NullPointerException while attempting to create a Spinner within a dialog and can't seem to debug it because the code looks solid. Wonder if anyone else has any idea. Any help is greatly appreciated. protected Dialog onCreateDialog(int id) { Dialog dialog; switch(id) { case DIALOG_SEND_PM: ...

How to connect 2 different spinners in Android 2.1

Hi guys, I am trying to create 2 different spinners in my main layout. This is how it works. Let's say the 1st spinner shows the different continents (e.g. America, Asia, Europe, etc.). Assume a user chooses Asia in the 1st spinner. My question is, how to make 2nd spinner to communicate with the 1st spinner? Meaning, the 2nd spinner i...

Custom spinner popup list in android

Is there a way to replace the standard ListView that pops up when opening a Spinner with a custom one? I would like for my Spinner list to be Filterable (and/or even possibly have two tabs with different lists the user could select options from). Is this achievable or do I have to do my own implementation alltogether? ...

Catch a Spinner selection with a Button?

Hello! As the title says, i have a Spinner with just a couple of options and a button. I didnt declared any Listener for the spinner, instead of that, what i want is use the button and perform different actions depending on the spinner selected option. So, i declared a handler in the button option "android:onClick", but once there, i d...

Creating a setError() for the Spinner

How do you create the setError() (similar to that of a TextView/EditText) function for a Spinner? The following doesn't work: I tried extending the Spinner class and in the constructor: ArrayAdapter<String> aa = new ArrayAdapter<String>(getContext(), android.R.layout.simple_spinner_item, android.R.id.text1, ...

How to connect 2 different spinners altogether

Hi guys, I am trying to connect 2 spinners together. Meaning, the items inside 2nd spinner will depend on whatever item is chosen for the 1st spinner. This is the code inside the main java file. public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); Spinner spinner = (Spin...

Android Spinner Control - Presetting an item as being selected

Hi My spinner control is displaying fine no problem. When someone is in create mode they are able to selected a value which I am able to record and store in my database. But I have a problem when someone is in edit mode and I want to display the list but have one of the items (say the third) selected. I can't see how to do that. All...

How to maintain jQuery ui numeric spinner between partial postbacks

I lose the spinner feature of my textbox when the page posts back. I am setting up this way: $("[id$='_txtSpinner']").spinner({ max: 60, min: 0 }); but after a partial postback the arrows are gone. I need something kind of like .live('click', function...) but I don't know the syntax to make it work for the spinner. I know I can get ...

Disappearing dividers in Spinner drop-down list

Hi experts, I am writing my first simple Android App: It loads temperature samples from a Java based measurement system (CSV via HTTP), shows the available channels in a Spinner and when a channel is selected, it shows the corresponding value and a timestamp in two TextViews. The App works fine, except a little cosmetic problem: The ite...

Android: Use spinner in a sub tab.

Hi, I'm trying to put a spinner in a sub-tab in my android app. Touching the spinner causes a crash. Searching seems to suggest that for some reason it is not possible to use spinners in sub-tabs, but this seems silly to me. I've also tried using activity groups as an alternative to sub-tabs, but I get the same crash. Has anyone...

Android - how to use Spinner to hide/display View objects

For an Android application, I'm trying to use a Spinner which, when an option is selected, will hide/display relevant View objects. For my application, these objects are an EditText and an associated TextView label for the field. Unfortunately, I can't seem to get the EditText to hide/display, and when I add it code to hide/display the T...

Selecting Android Spinner Causes WindowManager$BadTokenException

I created a custom AlertDialog to display a Spinner and some EditText elements. When I select a menu option, this custom AlertDialog gets launched. Everything works fine until I actually select the spinner to try and select an item, at which point I get the BadTokenException. I've read other StackOverflow posts saying that similiar excep...

Does it possible to create two "setOnItemSelectedListeners" on Spinner ?

Hello everyone, I have a problem about onItemSelected method of Spinner. There is no problem if I only have one Spinner. I can set a listener on that. I have a DB stored in sqlite. There is a table in which a column field contains date with year-month-date format. Then I created two Spinner views. One for month, and other for year. My p...

What is the best practice for opening a context-menu-like menu from a short button click?

I have a button that says "Sort" and when a user normal/short presses the button, I want a menu to appear with the various sort options. Looking around online there doesn't seem to be a straight forward answer to which route is considered best practice. I'm looking to have a menu that looks similar to this: http://farm3.static.flickr.c...

Two level list as Spinner popup (categorised selection list)

I am porting an application from iPhone to Android, in one of the screens the user can choose a value for a field. This value is selected from a list that has this form (the app in the screenshot is unrelated to my app) : Is there a similar control or a design pattern in Android to represent the same idea, a categorised selection list...