按照网上绝大多数人的说法,基本都是如下解决方案:
http://www.cnblogs.com/ycxyyzw/p/3672366.html
但是我的listview就是死活不能被点击,最后一点点删代码,发现BaseAdapter的isEnabled代码引发的问题,我直接全部返回false了。
如下copy官方解释:
isEnabled
Added in
API level 1
boolean isEnabled (int position)
Returns true if the item at the specified position is not a separator. (A separator is a non-selectable, non-clickable item). The result is unspecified if position is invalid. An ArrayIndexOutOfBoundsException
should be thrown in that case for fast failure.
Parameters | |
---|---|
position | int : Index of the item |
Returns | |
---|---|
boolean | True if the item is not a separator |
我直接所有都返回false,导致他们都不能被点击了。