14
所以我在适配器下面的代码:机器人 - 禁用ListView项点击重新启用它
@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个项目。所以重新绑定肯定不是一种选择。
感谢,
是的,这正是我如何解决它:)伟大的答案谢谢你! – dropsOfJupiter 2011-04-05 16:44:55