开发者

ListView Click and LongClick

开发者 https://www.devze.com 2023-02-14 17:30 出处:网络
I have a ListView with an ItemClickListener and an ItemLongClickListener. When you click an item, it starts a new activity. When you long click an item, it sets the visibility of a hidden textview in

I have a ListView with an ItemClickListener and an ItemLongClickListener. When you click an item, it starts a new activity. When you long click an item, it sets the visibility of a hidden textview in that row to visible.

When you long click, the hidden textview becomes visible, but when you release the click it starts the new activity, which I don't want.

How do I go about having both listeners? Also, I'm considering on a long click to make the hidden textview visible in all rows (using LongClic开发者_如何学GokListener instead of ItemLongClickListener), not just the clicked one but I'm unable to get it to even recognize a longclick then.


Return true to signalize that the event has been handled.

0

精彩评论

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