Listviewbutton indicates the focus of a button in listview.
Solution
Add android: descendantFocusability = "blocksDescendants" Button to android: focusable = "false" to the root node of Item xml. In this way, click "Button" and "ListView Item" to respond to their click events respectively.
A common problem in development is that the listview in a project is not just a simple text, but you often need to define your own listview, and your own Adapter will inherit the BaseAdapter and write it as needed,
The problem may occur. When you click an item, the system does not respond and cannot obtain the focus.
Most of the reasons are that sub-controls such as ImageButton, Button, and CheckBox exist in your own defined items (also called the sub-Control of Button or Checkable ), in this case, these child controls obtain the focus,
Therefore, when you click an item, the Sub-control is changed. The item's click does not respond. In this case, descendantFocusability can be used to solve the problem. This attribute defines the relationship between viewGroup and its child controls when a view obtains the focus. Three attribute values are available: beforeDescendants: viewgroup takes precedence over its subclass control and obtains focus afterDescendants: viewgroup obtains focus blocksDescendants only when its subclass control does not need focus: viewgroup will overwrite the subclass control and directly obtain the focus. Usually we use the third type, that is, add ** android: the attribute of descendantFocusability = "blocksDescendants" ** is ready, so far the flexibility event clicked by listview has come to an end.