-1

what is the use of setItemChecked method for a ListView? where can we use setItemChecked method for a ListView and why do we use it?

Darush
  • 9,625
  • 7
  • 53
  • 53
Kethan Chauhan
  • 53
  • 1
  • 2
  • 6
  • What is your actual problem? Are you having problems understanding the [documentation](https://developer.android.com/reference/android/widget/AbsListView.html)? – MarsAtomic Jul 08 '17 at 03:01

1 Answers1

0

I haven't used list views for a few years, I only use Recycler views, so my answer is based on brief research and intuition. Based on this thread and this thread and this documentation

I believe this method is to set that item in the listView as "selected". In some apps you can long press a list item to mark it as selected, so you can perform some action on it; for example, in contacts, you can select multiple contacts from the list and delete them together, or in gallery long click an image to edit or delete it etc.

So if you want to programatically select an item as checked/selected, you can use this method.

rgv
  • 1,072
  • 1
  • 15
  • 36