title: How to check login in android?
body: <p>In my project, There is a <code>splashActivity</code> then <code>LoginActivity</code> and on click <code>社交账号登录</code> it takes to <code>SocialCountLoginActivity</code>. If someone click on QQ login and if login get success then <code>MainActivity</code> starts. At that time I am finishing the <code>LoginActivity</code> and <code>SocialCountLoginActivity</code>.On restart application it's taking to <code>LoginAcivity</code> instead of <code>MainActivity</code>. What should I do to start <code>MainAcivity</code> directly after successful login?</p>
  
  <p>The following is my screenshot:</p>
  
  <p><a href="https://i.stack.imgur.com/WaShH.gif" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/WaShH.gif" alt="enter image description here"></a></p>
  
  <p>The folowing is my socialcountloginactivity part code:</p>
  
  <pre><code>private class  QQUIListener implements IUiListener{
  
      @Override
      public void onComplete(Object response) {
          //Login sucess
          //finish();
          JSONObject object = (JSONObject) response;
          initOpenidAndToken(object);
          getUserInfo();
      }
  
      @Override
      public void onError(UiError uiError) {
          //Login fail
      }
  
      @Override
      public void onCancel() {
          //Cancle Login
      }
  }
  </code></pre>
  
  <p>The following is mainactivity code:</p>
  
  <pre><code> @Override
  protected void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.activity_main);
  
      // finish activity
      ActivityManagerUtil.finishSomeOneActivity(SocialAccountLoginActivity.class);
      ActivityManagerUtil.finishSomeOneActivity(LoginActivity.class);
  </code></pre>
  
  <p>}</p>