Beispiel #1
0
 public static Shop getInstance(Context context) {
   String defValue = "";
   String string = SPUtil.getString(context, Constants.SP_SHOP, Constants.SP_SHOP, defValue);
   Shop bean = string.equals(defValue) ? null : MyGson.getInstance().fromJson(string, Shop.class);
   return bean;
 }
Beispiel #2
0
 /** "seaRecordId": 1 */
 public boolean saveInstance(Context context) {
   String spString = MyGson.getInstance().toJson(this);
   return SPUtil.saveString(context, Constants.SP_SHOP, Constants.SP_SHOP, spString);
 }