-1

Here is how I try to use ArrayList data to provide data for spinner 1

enter image description here

1
  • 1
    Please post your code as text. Commented Aug 31, 2016 at 8:43

2 Answers 2

1

Hope this Helps.

  private ArrayAdapter<CharSequence> arrayAdapter;
    arrayAdapter = new ArrayAdapter<CharSequence>(this, android.R.layout.simple_list_item_1, city);
Sign up to request clarification or add additional context in comments.

5 Comments

Thank a lot.. You Made This;-) @Dipali shah:-)
sorry @Dipali shah.. Again it seems give some error like adapter = new ArrayAdapter<String>(this, android.R.layout.simple_list_item_1,CityService.city); where City is public static ArrayList<String> city;
Actually It required <Java.lang.Charseq> and found <Java.Lang.String> while set adapter
ArrayAdapter<CharSequence> adapter; this my definition and using adapter = new ArrayAdapter<CharSequence>(MainActivity.this, android.R.layout.simple_list_item_1, city); where city is ** public static ArrayList<String> city;**
Working good.. Thanks a lot @Dipali shah
0

You should use something like mAdapter = new ArrayAdapter<String>(this, android.R.layout.simple_list_item_1, city)

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.