Question

I have Image Gallery in My Activity , When I click on Image, I am setting border to the imageview when onItemClick event is triggered , But When i select any other Image , Previous Image border should be erased , how to do that ?

Please suggest me some solution.

Was it helpful?

Solution

in onitem click

@Override
                public void onItemClick(AdapterView<?> parent,
                        View listviewitem, int position, long arg3) {
    if (lastHighlightItem != null) {
                        //change to previous border here
                    }
    View presentSelectedItem = listviewitem;
    //append the border here
    lastHighlightItem = listviewitem
    }
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top