List of usage examples for android.util SparseBooleanArray clone
@Override
public SparseBooleanArray clone()
From source file:Main.java
public static SparseBooleanArray cloneSBArray(SparseBooleanArray arr) { try {/* w w w. jav a2 s . c o m*/ return arr.clone(); } catch (Exception e) { // Happens when using HC - should clone manually int size = arr.size(); SparseBooleanArray clone = new SparseBooleanArray(); for (int i = 0; i < size; i++) { if (arr.get(arr.keyAt(i))) { clone.put(arr.keyAt(i), true); } } return clone; } }