Android ListView child View setEnabled() and setClickable() do nothing

前端 未结 4 910
有刺的猬
有刺的猬 2020-11-30 13:12

I\'m doing some AsyncTask work after user clicks an item in my ListView. I\'d like to disable the item so it can\'t be clicked twice. I\'ve simplif

4条回答
  •  庸人自扰
    2020-11-30 13:27

    Your problem is not completely clear. I am interpreting your question as that you are expecting onItemClick() to not be called based upon your setEnabled() and setClickable() calls.

    I'm not surprised that doesn't work, as onItemClick() is something ListView does, not the child view. Try overriding areAllItemsEnabled() and isEnabled() in your ListAdapter instead.

提交回复
热议问题