开发者

how to set onClickListener to item in ArrayAdapter?

开发者 https://www.devze.com 2023-03-05 07:52 出处:网络
I know what\'s setOnItemClickListener, but It set the listen to whole item. If m开发者_如何学JAVAy item contains a button to which I want to set listener, setOnItemClickListener doesn\'t help. I tried

I know what's setOnItemClickListener, but It set the listen to whole item. If m开发者_如何学JAVAy item contains a button to which I want to set listener, setOnItemClickListener doesn't help. I tried set listener in getView, but in vain.


Check this post for a nice solution: http://androidforbeginners.blogspot.com/2010/03/clicking-buttons-in-listview-row.html

(it actually works for any View: http://developer.android.com/reference/android/view/View.html#attr_android:onClick)

0

精彩评论

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