Android development in the ListView often has a button or imagebutton such as need to be clicked on the control, if not add some special restrictions, it is possible to the ListView item Click event or button click event, one of which cannot respond. The situation I encountered was that the ListView item could not respond to the Click event.
Workaround, add the following attribute to the XML file of the ListView item:
1) Add attribute android:descendantfocusability= "Blocksdescendants" to the root element of the entire XML file, such as LinearLayout
2) The controls that are clicked, such as ImageButton, add properties Android:focusable= "false" and android:clickable= "true"
Perfect solution!
This article was reproduced from: http://blog.csdn.net/dinglin_87/article/details/7878686#comments
The listview item is clicked and the button in it is clicked to take effect