Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 82ff241f authored by Cyril Mottier's avatar Cyril Mottier
Browse files

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
parent 53771e5f
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -919,9 +919,9 @@ public abstract class AbsListView extends AdapterView<ListAdapter> 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 <code>null</code> 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 <code>null</code> if the choice
     *          mode is set to {@link #CHOICE_MODE_NONE}.
     */
    public SparseBooleanArray getCheckedItemPositions() {
        if (mChoiceMode != CHOICE_MODE_NONE) {