每个微调器都应该有一个 OnItemSelectedListener,如下所示:
Spinner1.setOnItemSelectedListener(new OnItemSelectedListener() {
@Override
public void onNothingSelected(AdapterView<?> parent) {
}
@Override
public void onItemSelected(AdapterView<?> parent, View view, int pos, long id) {
// Get/set your info from the spinner here (depends on how you are populating the spinner
}
});
然后只需检查每个复选框的状态:
final CheckBox asiaCk = (CheckBox) findViewById(R.id.asia_cb);
if (asiaCk.isChecked()) {
// Set whatever data you need appropriately
}