0
The method setOnItemSelectedListener
is not called. I am trying to get a value of an item by means of a 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 did not get any results. Follow 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");
}
});