Android SharedPreferences Get getPrefObject(SharedPreferences pref, String key)

Here you can find the source of getPrefObject(SharedPreferences pref, String key)

Description

get Pref Object

Declaration

protected static Object getPrefObject(SharedPreferences pref, String key) 

Method Source Code

//package com.java2s;

import android.content.SharedPreferences;

import java.util.Map;

public class Main {
    protected static Object getPrefObject(SharedPreferences pref, String key) {

        Map<String, ?> all = pref.getAll();
        if (all != null) {
            Object obj = all.get(key);
            return obj;
        }/*w  w w.  j a va 2 s.c om*/

        return null;
    }
}

Related

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