答案 0 :(得分:2)
firstSpinner.setOnItemSelectedListener(this);
secondSpinner.setOnItemSelectedListener(this);
@Override
public void onItemSelected(AdapterView<?> parent, View v, int position, long id) {
Spinner spinner = (Spinner) parent;
switch (spinner.getId()) {
case R.id.first_spinner:
// item selected on the first spinner
// use position
break;
case R.id.second_spinner:
// item selected on the second spinner
// use position
break;
default:
break;
}
}