From 82ff241fd6a82843a8d9d87a1a01c7315079e3d4 Mon Sep 17 00:00:00 2001 From: Cyril Mottier Date: Tue, 23 Jul 2013 13:58:33 +0200 Subject: [PATCH] Update getCheckedItemPositions() documentation getCheckedItemPositions()'s documentation previously mentioned the returned SparseBooleanArray was only containing checked item positions (i.e. get(int position) always returning true). In practice, this is wrong, because getCheckedItemPositions() returns mCheckStates which basically contains all key-value mappings that have been used. As a consequence if the item at position p is checked and unchecked, the returned SparseBooleanArray will contain a (p, false) mapping. Another option could be to delete all keys having a false value. Change-Id: I15f8fc2a1ba3f1501af126c272b827402cfd8b14 --- core/java/android/widget/AbsListView.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/core/java/android/widget/AbsListView.java b/core/java/android/widget/AbsListView.java index 57bf0d3aee923..76a35049c20a8 100644 --- a/core/java/android/widget/AbsListView.java +++ b/core/java/android/widget/AbsListView.java @@ -919,9 +919,9 @@ public abstract class AbsListView extends AdapterView implements Te * the choice mode has not been set to {@link #CHOICE_MODE_NONE}. * * @return A SparseBooleanArray which will return true for each call to - * get(int position) where position is a position in the list, - * or null if the choice mode is set to - * {@link #CHOICE_MODE_NONE}. + * get(int position) where position is a checked position in the + * list and false otherwise, or null if the choice + * mode is set to {@link #CHOICE_MODE_NONE}. */ public SparseBooleanArray getCheckedItemPositions() { if (mChoiceMode != CHOICE_MODE_NONE) {