I know this question has been asked before and got an understanding roughly of whats happening but i cant seem to find a solution.

In my Custom List Adapter and inside `public View getView(int position, View convertView, ViewGroup parent) {` ive setup a click function for the items ImageButton.

```
final ImageButton bookmark = (ImageButton)
convertView.findViewById(R.id.bookmarkthis);
        bookmark.setTag(position);
        bookmark.setOnClickListener(new View.OnClickListener() {

            @Override
            public void onClick(View v) {

                bookmark.setImageResource(R.drawable.ic_bookmarked);
                bookmark.setTag(R.drawable.ic_bookmarked);

}

});

```

The Imagebutton is a clear star and when Clicked it changes that same drawable to a yellow star. It works Ok.

Problem is when i click Item in Position 0 Star Icon to make yellow , it also changes for item 8 further down the list not in View Yet. if i click position 1 changes also for position 9 and so on.

I had a look around and researched the issue and even tried a holder for the Imagebutton but no go. Something is preventing the drawable change for the ImageButton to its correct Position only.

Thanks

**Solution** is to initially Set a flag item in the array for each Item. Then onClick set the flag to true just for that item. Then in the getView its just a case of an if statement to check the flag as the Items get Cycled.

```
//in array creation
items.setFlag("false");

//in getView as you set Text and what ever get the Flag state
String flag = m.getFlag();

 //check the flag state and take action in this case change the icon accordingly
 if (Objects.equals(flag, "true")) {
            bookmark.setImageResource(R.drawable.ic_bookmarked);
            bookmark.setTag(R.drawable.ic_bookmarked);
        }

        else {
            bookmark.setImageResource(R.drawable.ic_bookmark);
        }

// and in the click function
           @Override
                public void onClick(View v) {

                    bookmark.setImageResource(R.drawable.ic_bookmarked);
                    m.setFlag("true");

    }

```