I got a ListView and I populate it with the view containing buttons. I set onClick listeners to the buttons from the adapted, but when I click the concrete item of the ListView - nothing happens. So, we can say only buttons onClick Listener is called, when I need listViewItem to be clicked. What to do?
Button onClick and ListView onItemClick
Asked Answered
Set to your button in xml file: android:focusable="false"
This is because your Button takes focus. So now you can use both onClick for your buttons, and onItemClick for each row in ListView, by telling it that Button should not be focusable.
yep try this one, i think this one is what u need –
Cutinize
you need to set on item click like this listView.setOnItemClickListener();
It is better to do the onlcick on listview item only.You can set some flag and toggle between the functionalities.
© 2022 - 2024 — McMap. All rights reserved.