AnyPref icon indicating copy to clipboard operation
AnyPref copied to clipboard

SharedPreferences实用工具类,可直接保存与读取实例对象

Results 2 AnyPref issues
Sort by recently updated
recently updated
newest added

操作方式如下: 保存数据: AnyPref.put(sample); //或者 AnyPref.put(sample, "your prefName");第二个参数是自己定义的保存此类的sharedPreferences name,不是PrefModel定义的那个name 读取数据 Sample sample = AnyPref.get(Sample.class); //或者 Sample sample = AnyPref.get(Sample.class, "your prefName");

如下 ``` AnyPref.getPrefs("sample")//或者new SharedPrefs("sample") .putLong("long", 920394857382L) .putInt("int", 63) .putString("string", "sample string"); ``` 其他字段有put方法, PrefSub对应的对象字段没有对应的方法.get方法也没有的. @NashLegend