Here you can find the source of toMap(SparseBooleanArray array)
public static Map<Integer, Boolean> toMap(SparseBooleanArray array)
//package com.java2s; //License from project: Apache License import java.util.Map; import android.util.SparseBooleanArray; import com.google.common.collect.Maps; public class Main { public static Map<Integer, Boolean> toMap(SparseBooleanArray array) { Map<Integer, Boolean> map = Maps.newHashMap(); for (int i = 0; i < array.size(); i++) { map.put(array.keyAt(i), array.valueAt(i)); }/* ww w .j a v a 2 s .c o m*/ return map; } }