title: Facebook login fail with Android App
body: <p>I am Using Facebook login for user registration in android app.It works for me but some times
  after clicking login button login window not open and screen hangup.
  As i guess this issue because of session time out,when app try to connect with Facebook but if Facebook not respond then this cause occur.So how can i solve this problem.</p>
  
  <p>Thanks in advance.</p>
  
  <p>Edited:- Code is -</p>
  
  <pre><code>private void initFacebook(Bundle savedInstanceState){
        uiHelper = new UiLifecycleHelper(this, callback);
        uiHelper.onCreate(savedInstanceState);
        mSessionTracker = new SessionTracker(this, callback);
        mSessionTracker.startTracking();
  }
  </code></pre>
  
  <p>and call back method which will call when user click on login button are-</p>
  
  <pre><code>private Session.StatusCallback callback = new Session.StatusCallback() {
          @Override
          public void call(Session session, SessionState state, Exception exception) {
              onSessionStateChange(session, state, exception);
             if(state!= null){
                  if(state.isOpened()){
                      mSession = session;
                      if(mLoginButton != null)
                       mLoginButton.setText(getString(R.string.loginwithfacebook));
                      showLoadingView();
                  }
              }
  
          }
   };
  
  
   private void onSessionStateChange(Session session, SessionState state, Exception exception) {
          if (pendingAction != PendingAction.NONE &amp;&amp; (exception instanceof FacebookOperationCanceledException ||
                  exception instanceof FacebookAuthorizationException)) {
                  new AlertDialog.Builder(BaseActivity.this)
                      .setTitle(R.string.cancelled)
                      .setMessage(R.string.permission_not_granted)
                      .setPositiveButton(R.string.ok, null)
                      .show();
              pendingAction = PendingAction.NONE;
          } else if (state == SessionState.OPENED_TOKEN_UPDATED) {
             handlePendingAction();
          }
      }
  </code></pre>
  
  <p>but the call back method not called some times.</p>