¡@

Home 

2014/10/16 ¤W¤È 08:24:50

android Programming Glossary: spinnerarrayadapter

Android - configure Spinner to use array

http://stackoverflow.com/questions/1587028/android-configure-spinner-to-use-array

this.findViewById R.id.Spinner01 Step 2 Create and fill an ArrayAdapter with a bunch of State objects ArrayAdapter spinnerArrayAdapter new ArrayAdapter this android.R.layout.simple_spinner_item new State new State 1 Minnesota MN new State 99 Wisconsin WI.. WI new State 53 Utah UT new State 153 Texas TX Step 3 Tell the spinner about our adapter spinner.setAdapter spinnerArrayAdapter You can retrieve the selected item as follows State st State spinner.getSelectedItem And now you have a bonafied java class..

Android: Create spinner programmatically from array

http://stackoverflow.com/questions/2784081/android-create-spinner-programmatically-from-array

String This is code I found on a site which should create the spinner Spinner spinner new Spinner this ArrayAdapter spinnerArrayAdapter new ArrayAdapter this android.R.layout.simple_spinner_dropdown_item spinnerArray spinner.setAdapter spinnerArrayAdapter.. new ArrayAdapter this android.R.layout.simple_spinner_dropdown_item spinnerArray spinner.setAdapter spinnerArrayAdapter Now the second line ArrayAdapter... gives me a warning in Eclipse saying ArrayAdapter is a raw type... References to generic.. improve this question ArrayAdapter String should work. i.e. Spinner spinner new Spinner this ArrayAdapter String spinnerArrayAdapter new ArrayAdapter String this android.R.layout.simple_spinner_dropdown_item spinnerArray spinner.setAdapter spinnerArrayAdapter..