I have a grid with an image in each item. On top of each image has another smaller image (visa icon, to say that the item was selected) only invisible. I'm trying to make when the person a long click the smaller image of the item he clicked is visible. How do you make this part of the item image invisible when clicked?
I tried this but it was not 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 just the image of the first item changes. I know the logic is wrong, that doing so it will really only change the first item, but as I am still learning Android, I am not able to make it visible only to the item pressed ...
How do you get the exact position? (it's capturing the right position, I've already checked log.d with position, the problem is when I get the correct image, since I did not mention any position, and I do not know how to do that)