如何做按钮的点击和列表视图项单击在Android的定制列表视图 [英] How to do Button click and list view item click in customize list view in android

查看:305
本文介绍了如何做按钮的点击和列表视图项单击在Android的定制列表视图的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有4个项目在我的列表视图中的这3个是文本视图,一个是在我的情况按钮,我已经从一个单一的列表中打开了2个新的活动

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

从按钮点击1号 从列表视图项点击第二个

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 working, also i am not able to handle the click of button.

我使用BaseAdapter类设置数据列表视图。

I am using BaseAdapter class to set the data in list view.

请帮我解决这个问题。

感谢。

推荐答案

或者你可以设置为您按钮

Or you can just set to you button

android:focusable="false"

在这种情况下,你的ListView将触发onItemClick动作监听器,按钮也将工作时它点击。

In this case you ListView will fire onItemClick action to listener, and the Button will also work when it clicked.

这篇关于如何做按钮的点击和列表视图项单击在Android的定制列表视图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆