You need to register the listener with your spinner like below code
if you are implementing the OnItemSelectedListener
like you are doing in the code provided by you. then register the listener like this
spinner.setOnItemSelectedListener(this);
or if you are creating a new class implementing the OnItemSelectedListener
interface.
then you can register that class with your spinner view like this
spinner.setOnItemSelectedListener(new MyCustomListener());
private class MyCustomListener implements OnItemSelectedListener
{
@Override
public void onItemSelected(AdapterView<?> arg0, View arg1, int arg2, long arg3){
// Write your logic what you want to do on selecting the item
}
@Override
public void onNothingSelected(AdapterView<?> arg0) {
}
}