Here you can find the source of getPrefBoolean(SharedPreferences pref, String key)
public static Boolean getPrefBoolean(SharedPreferences pref, String key)
//package com.java2s; import android.content.SharedPreferences; import java.util.Map; public class Main { public static Boolean getPrefBoolean(SharedPreferences pref, String key) { Object value = getPrefObject(pref, key); return value != null ? (Boolean) value : null; }/*from w w w . j av a 2s .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; } }