【发布时间】:2011-04-04 18:59:34
【问题描述】:
所以我在适配器中有以下代码:
@Override
public boolean isEnabled(int position)
{
GeneralItem item = super.getItem(position);
boolean retVal = true;
if (item != null)
{
if (currSection != some_condition)
retVal = !(item.shouldBeDisabled());
}
return retVal;
}
public boolean areAllItemsEnabled()
{
return false;
}
这里的问题:所以如果我在初始绑定期间禁用了我的项目,现在我会在屏幕上引发事件并且无论如何都需要启用它们。执行该操作后,我是否再次重新绑定?
例如:
onCreate{
// create and bind to adapter
// this will disable items at certain positions
}
onSomeClick{
I need the same listview with same items available for click no matter what the conditions of positions are, so I need them all enabled. What actions should I call on the adapter?
}
问题是我也可以有一个很长的列表视图。它应该支持6000个项目。所以重新绑定它当然不是一种选择。
谢谢,
【问题讨论】: