Here you can find the source of getPrefBoolean(SharedPreferences pref, String key)
public static Boolean getPrefBoolean(SharedPreferences pref, String key)
//package com.java2s; import java.util.Map; import android.content.SharedPreferences; public class Main { public static Boolean getPrefBoolean(SharedPreferences pref, String key) { Object value = getPrefObject(pref, key); return value != null ? (Boolean) value : null; }/*from w ww . j a va 2 s. co m*/ protected static Object getPrefObject(SharedPreferences pref, String key) { Map<String, ?> all = pref.getAll(); if (all != null) { Object obj = all.get(key); return obj; } return null; } }