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:
http://i.stack.imgur.com/fjURS.png
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;
}
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With