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

Commit bed64a2c authored by Android (Google) Code Review's avatar Android (Google) Code Review Committed by The Android Open Source Project
Browse files

am 83f6b130: Merge change 5237 into donut

Merge commit '83f6b130'

* commit '83f6b130':
  Calling setItemChecked(p, true) twice would toggle the selection in ListView.
parents 217b208e 83f6b130
Loading
Loading
Loading
Loading
+6 −2
Original line number Diff line number Diff line
@@ -3264,9 +3264,13 @@ public class ListView extends AbsListView {
        if (mChoiceMode == CHOICE_MODE_MULTIPLE) {
            mCheckStates.put(position, value);
        } else {
            boolean oldValue = mCheckStates.get(position, false);
            // Clear the old value: if something was selected and value == false
            // then it is unselected
            mCheckStates.clear();
            if (!oldValue) {
            // If value == true, select the appropriate position
            // this may end up selecting the value we just cleared but this way
            // we don't have to first to a get(position)
            if (value) {
                mCheckStates.put(position, true);
            }
        }