setOnItemClickListener doesn\'t work with android Spinner. Here is my code:
supplier.setOnItemClickListener(new OnItemClickListener() {
@Ove
I think supplier
in your code means spinner
, do Replace this line
String msupplier=supplier.getSelectedItem().toString();
with the below line:
String msupplier= supplier.getItemAtPosition(position).toString();
i have faced this issues. setOnItemClickListener will not works with spinner. My solution is as following:
mSpinnerYears.setAdapter(adapter);
mSpinnerYears.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
@Override
public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {
Logger.d(new StringBuilder(2).append("TAG:").append(TAG).toString(),
new StringBuilder(3).append("click pos = ").append(position).append(
mSpinnerYears.getItemAtPosition(position).toString()).toString());
}
@Override
public void onNothingSelected(AdapterView<?> parent) {
}
});