Android examples for android.util:SparseArray
Clones a SparseArray.
//package com.java2s; import android.util.SparseArray; public class Main { /** Clones a SparseArray. */ public static <E> SparseArray<E> cloneSparseArray(SparseArray<E> orig) { SparseArray<E> result = new SparseArray<E>(); for (int i = 0; i < orig.size(); i++) { result.put(orig.keyAt(i), orig.valueAt(i)); }/* www. j a va2 s . c om*/ return result; } }