I’m writing an application which has a gridView. This gridview consists of several imageViews. I’m able to set the background for a clicked item. But I need to set the background for several items.
The following code didn’t help me:
gridview.setOnItemClickListener(new OnItemClickListener() {
public void onItemClick(AdapterView<?> parent, View v, int position, long id) {
for(int eachCoordinate: coordinates){
gridview.getChildAt(eacheachCoordinate).setBackgroundResource(R.drawable.point);
}
I found the solution: I should change adapter resources and then invalidate gridView.