Don\'t know how to express myslef very well.As you see down in my code I have a String,an ArrayList of Strings and a spinner.
In my code I add the elements of my String
Change u r code "accounts" used two times. Make arraylist for accounts and load into spinner.
Spinner spinner1 = (Spinner) findViewById(R.id.spinner1);
List accountsList = new ArrayList();
accountsList.add("one");
accountsList.add("two");
accountsList.add("three");
accountsList.add("four");
ArrayAdapter dataAdapter = new ArrayAdapter
(this,android.R.layout.simple_spinner_item,accountsList);
dataAdapter.setDropDownViewResource
(android.R.layout.simple_spinner_dropdown_item);
spinner1.setAdapter(dataAdapter);
// Spinner item selection Listener
addListenerOnSpinnerItemSelection();
// Button click Listener
addListenerOnButton();
Follow this Tutorial