So I have this code:
converteeUnit.setOnItemSelectedListener(new OnItemSelectedListener(){
@Override
public void onItemSelected(AdapterView<?> parent, View arg1,
int arg2, long arg3) {
// TODO Auto-generated method stub
}
@Override
public void onNothingSelected(AdapterView<?> arg0) {
// TODO Auto-generated method stub
}
}) ;
I am trying change this but I do not understand the parameters for the OnItemSelected method. What does each one mean and what would I need specifically to implement spinner called convertedUnit, for this example? Also how could I have it do the same thing as before while I also insert my desired code?
When in doubt, always check the documentation.
dialog/dropdown)
not useful to you)
Not sure what you’re trying to do, but in general you want to use the
positionto get the value from theAdapteryou used to populate the Spinner. You can always usespinner.getAdapter().getItem(position)