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
Try below code.
ArrayList spinnerAccounts = new ArrayList<>(); // I don't know the use of this ArrayList
Spinner accounts = (Spinner)findViewById(R.id.accounts);
ArrayAdapter adapter =
new ArrayAdapter(this,android.R.layout.simple_spinner_item,spinnerAccounts);
adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
accounts.setAdapter(adapter);
spinnerAccounts.add("one");
spinnerAccounts.add("two");
spinnerAccounts.add("three");
spinnerAccounts.add("four");
adapter.notifyDataSetChanged();
Add items you want to display in
Spinner
usingspinnerAccounts.add("ACCOUNT_NAME")
method.
Hope It'll help you.