Android SharedPreferences Get getPrefInt(Context c, String key, int defValue)

Here you can find the source of getPrefInt(Context c, String key, int defValue)

Description

get Pref Int

Declaration

public static int getPrefInt(Context c, String key, int defValue) 

Method Source Code

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

public class Main {
    public static int getPrefInt(Context c, String key, int defValue) {
        SharedPreferences sp = PreferenceManager
                .getDefaultSharedPreferences(c);
        return sp.getInt(key, defValue);
    }//w  ww  .  ja  va2 s  .c o m
}

Related

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