How can Check the condition of the two spinner?
I have two spinners in my project. I want to write unit conversion project How can the different conditions of the selected spinners item Understand ?
Similar to the image below:
How can Check the condition of the two spinner?
I have two spinners in my project. I want to write unit conversion project How can the different conditions of the selected spinners item Understand ?
Similar to the image below:
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;
}
}
© 2022 - 2024 — McMap. All rights reserved.