这段代码运行良好,但它只动态创建一个 微调器以及我想在不同的微调器中加载不同的项目请告诉我如何做到这一点?
public class DisciplineActivity extends Activity
{ ArrayList<String> selectDisciplineArrayList,disciplineInfoArrayList;
@Override
protected void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
setContentView(R.layout.discipline_view);
for(int i=0;i<20;i++)
{
disciplineInfoArrayList.add("select location item:"+i);
}
// for(int i=0;i<5;i++)
//{
Spinner disciplineInfoSpinner = new Spinner(this);
ArrayAdapter<String> spinnerArrayAdapter = new ArrayAdapter<String>(
this, android.R.layout.simple_spinner_item,disciplineInfoArrayList);
spinnerArrayAdapter.setDropDownViewResource( android.R.layout.simple_spinner_dropdown_item );
disciplineInfoSpinner = (Spinner) findViewById(R.id.disciplineinfo_spinner);
disciplineInfoSpinner.setAdapter(spinnerArrayAdapter);
}//
}