title: Facebook login fails with facebook app installed
body: <p>I'm new to android development. I've downloaded facebook sdk 3.0.1, and using the sample code to log in. The problem is, that if facebook app is installed the authentication fails.
  (otherwise it works just fine)
  after pressing the log in button I get to onActivityResult with status CLOSED_LOGIN_FAILED.
  of course I'm not typing the password, it's done automatically through facebook's app, and the facebook app is logged in and works properly.
  I couldn't find a solution..
  please help me :)</p>
  
  <p>this is my code:</p>
  
  <pre><code>@Override
  protected void onCreate(Bundle savedInstanceState) {
      instance = this;
      super.onCreate(savedInstanceState);
      setContentView(R.layout.activity_main);
      buttonLoginToFacebook = (Button) findViewById(R.id.buttonLoginToFacebook);
      tvWellcome = (TextView) findViewById(R.id.tvWellcome);
  
      Settings.addLoggingBehavior(LoggingBehavior.INCLUDE_ACCESS_TOKENS);
  
      Session session = Session.getActiveSession();
      if (session == null) {
          if (savedInstanceState != null) {
              session = Session.restoreSession(this, null, statusCallback,
                      savedInstanceState);
          }
          if (session == null) {
              session = new Session(this);
          }
          Session.setActiveSession(session);
          if (session.getState().equals(SessionState.CREATED_TOKEN_LOADED)) {
              session.openForRead(new Session.OpenRequest(this)
                      .setCallback(statusCallback));
          }
      }
  
      updateView();
  }
  
  @Override
  public void onStart() {
      super.onStart();
      Session.getActiveSession().addCallback(statusCallback);
  }
  
  @Override
  public void onStop() {
      super.onStop();
      Session.getActiveSession().removeCallback(statusCallback);
  }
  
  @Override
  public void onActivityResult(int requestCode, int resultCode, Intent data) {
      super.onActivityResult(requestCode, resultCode, data);
      Session.getActiveSession().onActivityResult(this, requestCode,
              resultCode, data);
      updateView();
  }
  
  @Override
  protected void onSaveInstanceState(Bundle outState) {
      super.onSaveInstanceState(outState);
      Session session = Session.getActiveSession();
      Session.saveSession(session, outState);
  }
  
  private void updateView() {
      Session session = Session.getActiveSession();
      if (session.isOpened()) {
          Intent intent = new Intent(this, ScreenStartPage.class);
          startActivity(intent);
      } else {
          buttonLoginToFacebook.setOnClickListener(new OnClickListener() {
              public void onClick(View view) {
                  onClickLogin();
              }
          });
      }
  }
  
  private void onClickLogin() {
      Session session = Session.getActiveSession();
      if (!session.isOpened() &amp;&amp; !session.isClosed()) {
          session.openForRead(new Session.OpenRequest(this)
                  .setCallback(statusCallback));
          updateView();
      } else {
          Session.openActiveSession(this, true, statusCallback);
      }
  }
  
  
  public void onClickLogout() {
      Session session = Session.getActiveSession();
      if (!session.isClosed()) {
          session.closeAndClearTokenInformation();
      }
  }
  
  private class SessionStatusCallback implements Session.StatusCallback {
      @Override
      public void call(Session session, SessionState state,
              Exception exception) {
          updateView();
      }
  }
  </code></pre>