1. onItemLongClick and onItemClick event Interception
To obtain both the onItemLongClick event and onItemClick event of a listview entry, you only need to return true in the onItemLongClick event trigger function.
2. Customize the CheckBox Style
Add the android: button attribute to the layout file. <喎?http: www.bkjia.com kf ware vc " target="_blank" class="keylink"> VcD4KPHA + PHByZSBjbGFzcz0 = "brush: java;"> Checkbox_selector.xml
Checkbox_selected_selector.xml
Checkbox_blank_selector.xml
3. The focus of a button or checkBox Item in ListView
When you customize a ListView, each Item contains a Button component or other component that can be clicked (usually button and checkbox) in addition to the text. When you click this item, it may not respond, this is because the focus is obtained by the button component. When you click an item, it is actually equivalent to clicking the button component.
Solution: add the following content to the root layout of the item.
Android: descendantFocusability = "blocksDescendants"
You can also add the following content to the button component:
android:focusable="false"