title: How can I avoid a delay after logged in facebook successfully?
body: <p>Here is my code to redirect HomeActivity after logged in facebook successfully, but it has a delay. Who can show me the way to avoid it or show the ProgressDialog instead of the delay. Thanks for your helps.</p>
  
  <pre><code>callbackManager = CallbackManager.Factory.create();
      LoginManager.getInstance().registerCallback(callbackManager, new FacebookCallback&lt;LoginResult&gt;() {
          @Override
          public void onSuccess(LoginResult loginResult) {
              startActivity(new Intent(getActivity(), HomeActivity.class));
          }
  
          @Override
          public void onCancel() {
              Log.e("login", "cancel");
          }
  
          @Override
          public void onError(FacebookException error) {
              Log.e("login", "error");
          }
      });
  </code></pre>