我想在运行时设置 android spinner item 值。
这是我到目前为止所拥有的:
final ArrayAdapter<String> calsListAdapter = new ArrayAdapter<String>( this,
android.R.layout.simple_list_item_1, calendarNames);
eventCalendarList.setAdapter(calsListAdapter);
eventCalendarList.setOnItemSelectedListener(new OnItemSelectedListener() {
public void onItemSelected(AdapterView<?> arg0, View arg1, int arg2, long arg3) {
calendarChoosen = availableCals.get(arg2);
}
public void onNothingSelected(AdapterView<?> arg0) {
Logger.d("Cal Choosen", "fffffffffffffff");
}
});
private List<AvailableCalendar> availableCals = new ArrayList<AvailableCalendar>();
private AvailableCalendar calendarChoosen;
但是没有设置值。怎么做到呢?