public static User getInstantce() { if (instantce == null) { Object object = FileUtil.restoreObject(AppContants.CACHE_PATH + TAG); if (object == null) { // App第一次启动,文件不存在,则新建之 object = new User(); FileUtil.saveObject(AppContants.CACHE_PATH + TAG, object); } instantce = (User) object; } return instantce; }
public void saveInfo() { FileUtil.saveObject(AppContants.CACHE_PATH, this); }