diff --git a/core/java/android/widget/AbsListView.java b/core/java/android/widget/AbsListView.java index 0d287cfdf8f2a..38bb2e1bde811 100644 --- a/core/java/android/widget/AbsListView.java +++ b/core/java/android/widget/AbsListView.java @@ -1443,14 +1443,13 @@ public abstract class AbsListView extends AdapterView implements Te inActionMode = in.readByte() != 0; checkedItemCount = in.readInt(); checkState = in.readSparseBooleanArray(); - long[] idState = in.createLongArray(); - int[] idPositions = in.createIntArray(); - - final int idLength = idState.length; - if (idLength > 0) { + final int N = in.readInt(); + if (N > 0) { checkIdState = new LongSparseArray(); - for (int i = 0; i < idLength; i++) { - checkIdState.put(idState[i], idPositions[i]); + for (int i=0; i implements Te out.writeByte((byte) (inActionMode ? 1 : 0)); out.writeInt(checkedItemCount); out.writeSparseBooleanArray(checkState); - out.writeLongArray(checkIdState != null ? checkIdState.getKeys() : new long[0]); - - int size = checkIdState != null ? checkIdState.size() : 0; - int[] idPositions = new int[size]; - if (size > 0) { - for (int i = 0; i < size; i++) { - idPositions[i] = checkIdState.valueAt(i); - } - out.writeIntArray(idPositions); + final int N = checkIdState != null ? checkIdState.size() : 0; + out.writeInt(N); + for (int i=0; i