The setOnItemSelectedListener
method is not called. I'm trying to get an item value through spinner
, but when I click on the item I want, nothing happens.
I created a TAG to check if the method is being called and I got no results. Here is the code:
adapter = new ArrayAdapter < String > (this, android.R.layout.simple_spinner_dropdown_item, listColab);
adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
spinnerProf.setAdapter(adapter);
spinnerProf.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
@Override
public void onItemSelected(AdapterView << ? > adapterView, View view, int i, long l) {
Log.i(TAG, adapterView.getItemAtPosition(i).toString());
}
@Override
public void onNothingSelected(AdapterView << ? > adapterView) {
Log.i(TAG, "teste");
}
});