I have 4 items in my list view in these 3 are text view and one is button in my case i have to open 2 new activities from a single list
1st from on button click 2nd from on list view item click
but when i add the button in list view list click is not working, also i am not able to handle the click of button.
I am using BaseAdapter class to set the data in list view.
Please help me to solve this.
Thanks.
Or you can just set to you button
android:focusable="false"
In this case you ListView will fire onItemClick action to listener, and the Button will also work when it clicked.
The previous answers to this didn't worked for me.
Add to your row's root layot android:descendantFocusability="blocksDescendants", this really does the trick, the buttons keep working and the list keeps firing the event.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With