@@ -0,0 +1,1787 @@
+/** SharedPreferences%E7%AE%80%E6%98%93%E5%AD%98%E5%8F%96%E3%80%82 */%0Apublic class Prefs %7B%0A    /**%0A     * %E5%90%91%E9%A6%96%E9%80%89%E9%A1%B9%E4%B8%AD%E8%AE%BE%E7%BD%AE%E5%80%BC%E3%80%82%3C/br%3E%0A     *%0A     * value%E7%9A%84%E5%AE%9E%E9%99%85%E7%B1%BB%E5%9E%8B%E9%9C%80%E8%A6%81%E6%98%AF%3Cb%3Eboolean%3C/b%3E%E3%80%81%3Cb%3Efloat%3C/b%3E%E3%80%81%3Cb%3Eint%3C/b%3E%E3%80%81%3Cb%3Elong%3C/b%3E%E3%80%81%3Cb%3EString%3C/b%3E%E4%B9%8B%E4%B8%80%EF%BC%8C%E5%90%A6%E5%88%99%E4%B8%8D%E4%BD%9C%E5%A4%84%E7%90%86%E3%80%82%0A     * */%0A    public static void put(Context context, String key, Object value) %7B%0A        Editor editor = context.getSharedPreferences(context.getPackageName(), Context.MODE_PRIVATE).edit();%0A%0A        if (value instanceof Boolean) %7B%0A            editor.putBoolean(key, (Boolean) value);%0A        %7D else if (value instanceof Float) %7B%0A            editor.putFloat(key, (Float) value);%0A        %7D else if (value instanceof Integer) %7B%0A            editor.putInt(key, (Integer) value);%0A        %7D else if (value instanceof Long) %7B%0A            editor.putLong(key, (Long) value);%0A        %7D else if (value instanceof String) %7B%0A            editor.putString(key, (String) value);%0A        %7D else %7B%0A            // %E6%8C%89%E8%AF%B4%E5%BA%94%E8%AF%A5%E6%8A%9B%E5%BC%82%E5%B8%B8%E3%80%82%0A        %7D%0A%0A        editor.commit();%0A    %7D%0A%0A    /** %E4%BB%8E%E9%A6%96%E9%80%89%E9%A1%B9%E4%B8%AD%E5%8F%96%E5%80%BC%E3%80%82 */%0A    @SuppressWarnings(%22unchecked%22)%0A    public static %3CP%3E P get(Context context, String key, P defValue) %7B%0A        SharedPreferences prefs = context.getSharedPreferences(context.getPackageName(), Context.MODE_PRIVATE);%0A%0A        Object result = null;%0A%0A        if (defValue instanceof Boolean) %7B%0A            result = prefs.getBoolean(key, (Boolean) defValue);%0A        %7D else if (defValue instanceof Float) %7B%0A            result = prefs.getFloat(key, (Float) defValue);%0A        %7D else if (defValue instanceof Integer) %7B%0A            result = prefs.getInt(key, (Integer) defValue);%0A        %7D else if (defValue instanceof Long) %7B%0A            result = prefs.getLong(key, (Long) defValue);%0A        %7D else if (defValue instanceof String) %7B%0A            result = prefs.getString(key, (String) defValue);%0A        %7D%0A%0A        return (P) result;%0A    %7D%0A%7D%0A

Create Prefs.java