Android : Spinner初始化时填充默认值数据

 

---------------------------------------华丽的分割线-----------------------------------------

 

ArrayAdapter adapter = new ArrayAdapter
(this, android.R.layout.simple_layout,  /*here is your array list*/);   

spinner.setAdapter(adapter);

int position = adapter.getPosition(/*here is some string in your array list*/);

spinner.setSelection(position ,  true);

 

 

 

你可能感兴趣的:(Android)