Android Spinner Position And If Statements
Having an odd issue here and don't know why it doesn't work, I'm not that used to java yet. to determine the selected item what needs to be done? the spinner has 8 items and 'posit
Solution 1:
You have to implement the proper listener for the spinner.
yourSpinner.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener()
@Override
public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {
if (position == 1){
//Do something}
}
}
@Override
public void onNothingSelected(AdapterView parent) {
// Do nothing.
}
});
If you're "not that used to Java" I recommend you read some basics.
Post a Comment for "Android Spinner Position And If Statements"