1
I have a grid with an image on each item. On top of each image has another smaller image (visa icon, to say that the item has been selected) only invisible. I’m trying to make when the person gives a long click the smaller image of the item he clicked becomes visible. How to make this part of the item image invisible when clicked?
I’ve tried this but not quite right
listView.setOnItemLongClickListener(new AdapterView.OnItemLongClickListener() {
@Override
public boolean onItemLongClick(AdapterView<?> parent, View view, int position, long id) {
Log.d("CLICK", "LONG CLICK");
selectedImageView = (ImageView) findViewById(R.id.selectedImageView);
selectedImageView.setVisibility(View.VISIBLE);
return true;
}
});
So only the image of the first item changes. I know the logic ta wrong, that doing so it will really change only the first item, but as I’m still learning Android, I’m not able to make it visible only to the pressed item...
How do I get him to pick up the exact position? (he’s capturing the right position, I’ve checked log. d with position, the problem is when to get the correct image, since I didn’t mention any position, and I don’t know how to do that)