Spinner初始化时填充字符串数据

ArrayAdapter<String>adapter=newArrayAdapter<String>

(this,android.R.layout.simple_layout,/*hereisyourarraylist*/);

spinner.setAdapter(adapter);

intposition=adapter.getPosition(/*hereissomestringinyourarraylist*/);

spinner.setSelection(position,true);

相关推荐