Clicking a button and clicking ListView

I have a ListView . when I click on a list item, I start a Activity . Now I added a Button to the ListView and clicked the button I want to start another action. After adding the button, I can click the button and start the action, but now I can not click on the list item. What happened to the listview list item?

0
android listview buttonclick onitemclick
Sep 23 '11 at 17:59
source share
2 answers

Read this excellent blog post: Ask List Box and ImageButtons Problems

Essentially, you should add the following to your root layout element in the line XML file.

android:descendantFocusability="blocksDescendants"

+9
Dec 01 2018-11-11T00:
source share

this is a concept. If you want to implement both clicks, click the OK button, as usual, and clicking a list item does not use a list click.

Instead, you write an onclick listener for the converted view that you returned in getview ()

Then both clicks will work

0
Sep 23 '11 at 18:23
source share



All Articles