//注册spinner
final Spinner spinner = (Spinner) findViewById(R.id.mySpinner);
//写监听器
spinner.setOnItemSelectedListener(new OnItemSelectedListener() {
//写监听方法
public void onItemSelected(AdapterView<?> parent, View view,
int position, long id) {
//存数据
s1 = spinner.getSelectedItem().toString();
}
//重写方法
@Override
public void onNothingSelected(AdapterView<?> arg0) {
// TODO Auto-generated method stub
}
});