Ari
Ari

Reputation: 3127

Android ListView checked items base on id instead of position

Android ListView show elements as checked base on element position. So if I add new element to the top, while some elements are checked, or remove element from the middle, wrong elements are shown as checked.

I have access to checked items ids list.

Is it possible to update ListView to show only checked items as checked? On which event I should do this (which method should I override)?

Upvotes: 0

Views: 101

Answers (2)

Ari
Ari

Reputation: 3127

It was a bug in old Android version. I wasn't able to fix it there. In newer Androids it doesn't exist.

Upvotes: 0

Armaan Stranger
Armaan Stranger

Reputation: 3130

You can try this::

for this purpose you can use custom adapter for listview and in listview adapter there is GetView() method that can be used to achieve that you want.

Here is the Link for more info and Example

Hope it Helps!!

Upvotes: 1

Related Questions