我正在尝试创建一个ListView,您可以一次点击不超过4个项目。 这些项目必须彼此相邻。ListView - 获取点击项目的相邻项目
当我点击我的第一个项目,我想看看是否先前或以下项目已被点击。
注:当我单击一个项目时,我更改背景颜色。所以如果我想告诉一个项目是否被点击,我只想检查背景颜色。
public void OnItemClick(AdapterView<?> parent, View, view, int position, long id){
View currentItem = view;
currentItem.setBackgroundResource(R.drawable.li_gradient);
// How do I get the view in front of and behind currentItem
// to check their current background color? (Assuming they exist)
}