Android SharedPreferences Get getPrefBoolean(Context c, String key, boolean defValue)

Here you can find the source of getPrefBoolean(Context c, String key, boolean defValue)

Description

get Pref Boolean

Declaration

public static boolean getPrefBoolean(Context c, String key,
            boolean defValue) 

Method Source Code

//package com.java2s;
import android.content.Context;
import android.content.SharedPreferences;
import android.preference.PreferenceManager;

public class Main {
    public static boolean getPrefBoolean(Context c, String key,
            boolean defValue) {
        SharedPreferences sp = PreferenceManager
                .getDefaultSharedPreferences(c);
        return sp.getBoolean(key, defValue);
    }/*from  w w w  . j a v  a 2s.c o  m*/
}

Related

  1. getPrefBoolean(SharedPreferences pref, String key)
  2. getPrefInt(SharedPreferences pref, String key, String default_value)
  3. getPrefInt(SharedPreferences pref, String key, int default_value)
  4. getPrefObject(SharedPreferences pref, String key)
  5. getPrefObject(SharedPreferences pref, String key)
  6. getPrefInt(Context c, String key, int defValue)
  7. getPrefString(Context c, String key, String defValue)
  8. getSaltFromPreferences(SharedPreferences prefs)
  9. getPinHashFromPreferences(SharedPreferences prefs)