So I\'m trying to set up a setOnClickListener for my ListView but it\'s causing a crash in my program for some reason when I try... I\'m quite new
In my case I try to add onClickListener for spinner and I've got the same problem. I've crated workaround with touch listener. Sometimes we need it for hideKeyBoard or send some analyticEvent:
someSpinner.setOnTouchListener { _, event -> onTouchSomeSpinner(event)}
fun onTouchSomeSpinner(event: MotionEvent): Boolean {
if(event.action == MotionEvent.ACTION_UP) {
view.hideKeyBoard()
view.analyticsEvent()
...
}
return false
}