开发者

How to do Button click and list view item click in customize list view in android

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 work开发者_StackOverflow中文版ing, 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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜