I have a spinner which drops down when a button is clicked. But when I am trying to set onItemSelectedListener, it is not taking the click events.
spnrLocation.setOnItemSelectedListener(new OnItemSelectedListener() {
@Override
public void onItemSelected(AdapterView<?> parent, View arg1,
int arg2, long arg3) {
System.out.println("location clicked" + arg2);
edtLocation.setText(parent.getItemAtPosition(arg2).toString());
System.out.println("wfefe"
+ parent.getItemAtPosition(arg2).toString());
}
@Override
public void onNothingSelected(AdapterView<?> arg0) {
}
});
Any
View
supports the android:clickable attribute (which lets you make anyView
behave like aButton
). There is also android:focusable.