Selaa lähdekoodia

fixbug:退出登录UI没刷新问题

Sora 1 vuosi sitten
vanhempi
commit
afadaba0e8
1 muutettua tiedostoa jossa 4 lisäystä ja 1 poistoa
  1. 4 1
      app/src/main/java/com/sheep/gamegroup/util/CommonUtil.java

+ 4 - 1
app/src/main/java/com/sheep/gamegroup/util/CommonUtil.java

@@ -51,6 +51,7 @@ import com.sheep.gamegroup.alipay.PayResult;
 import com.sheep.gamegroup.event.BigEvent;
 import com.sheep.gamegroup.event.EventTypes;
 import com.sheep.gamegroup.event.ValueCallback;
+import com.sheep.gamegroup.gaiban.mainpage.data.source.UserInfoDataSource;
 import com.sheep.gamegroup.greendao.DDProviderHelper;
 import com.sheep.gamegroup.greendao.download.AcceptTaskRecord;
 import com.sheep.gamegroup.greendao.download.DownLoadInfo;
@@ -659,12 +660,14 @@ public class CommonUtil {
                 activity.hideProgress();
             }
         });
+        UserInfoDataSource.getInstance().logout();
+        EventBus.getDefault().post(new BigEvent().setEventTypes(EventTypes.USER_LOGOUT));
         SpUtils.saveToken(activity, "");
         DataUtil.getInstance().clearData();
         SpUtils.clearQQGameData(SheepApp.getInstance());
         //删除自动审核任务中保存的数据,防止用户切换账号后直接提交
         DDProviderHelper.getInstance().deleteTaskRecord();
-        Intent intent = new Intent(activity, ActMain.class).setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
+        Intent intent = new Intent(activity, ActMain.class);
         intent.putExtra("INTENT_ACTION", "LOGOUT");
         activity.startActivity(intent);
         activity.finish();