title: Cannot log out while using the Facebook SDK - Android
body: <p>I have been trying to learn this Facebook SDK for a couple days now and i seem to be stuck. I am building a basic application for a school project, when a user logs in for THE FIRST TIME, Facebook allows you to type in an email and your password and it signs you in. Once the user clicks "Log Out" i log out.. To my knowledge. Now when i go back to click sign on, it auto logs back into that last account. Doesn't give me an option to switch accounts. How can i fix this?</p>
  
  <p>EDIT*** When i log in, then log out, then click log in again it says "You previously logged in to "APP NAME" with Facebook. Would you like to continue?"</p>
  
  <p>The only options are cancel and continue. I can't even try to sign in with a different person! This is my issue, if anyone can solve it that would be awesome! in the mean time i will keep trying different things</p>
  
  <pre><code>package example.com.demo_app;
  
  import android.content.Intent;
  import android.support.v7.app.AppCompatActivity;
  import android.os.Bundle;
  import android.widget.TextView;
  
  import com.facebook.AccessToken;
  import com.facebook.AccessTokenTracker;
  import com.facebook.CallbackManager;
  import com.facebook.FacebookActivity;
  import com.facebook.FacebookCallback;
  import com.facebook.FacebookException;
  import com.facebook.FacebookSdk;
  import com.facebook.GraphRequest;
  import com.facebook.GraphResponse;
  import com.facebook.appevents.AppEventsLogger;
  import com.facebook.login.LoginBehavior;
  import com.facebook.login.LoginManager;
  import com.facebook.login.LoginResult;
  import com.facebook.login.widget.LoginButton;
  import com.facebook.login.widget.ProfilePictureView;
  
  import org.json.JSONException;
  import org.json.JSONObject;
  import org.w3c.dom.Text;
  
  public class MainActivity extends AppCompatActivity {
  
  LoginButton fbButton;
  CallbackManager callBackManager;
  
  TextView nameBox;
  TextView emailBox;
  TextView idBox;
  
  @Override
  protected void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.activity_main);
  
  
  
      fbButton = (LoginButton)findViewById(R.id.login_button);
      fbButton.setReadPermissions("email", "public_profile");
  
      callBackManager = CallbackManager.Factory.create();
      fbButton.registerCallback(callBackManager, new FacebookCallback&lt;LoginResult&gt;() {
          @Override
          public void onSuccess(LoginResult loginResult) {
  
  
              String user_id = loginResult.getAccessToken().getUserId();
  
  
  
              GraphRequest graphRequest = GraphRequest.newMeRequest(loginResult.getAccessToken(), new GraphRequest.GraphJSONObjectCallback() {
                  @Override
                  public void onCompleted(JSONObject object, GraphResponse response) {
  
  
                      if (object != null)
                      {
                          displayInfo(object);
                      }
                      else {
                          LoginManager.getInstance().logOut();
  
                      }
                  }
              });
  
              Bundle parameters = new Bundle();
              parameters.putString("fields", "first_name, last_name, email, id");
              graphRequest.setParameters(parameters);
              graphRequest.executeAsync();
  
  
          }
  
          @Override
          public void onCancel() {
  
  
          }
  
          @Override
          public void onError(FacebookException error) {
  
          }
      });
  
  
  }
  
  public void displayInfo(JSONObject object)
  {
      String first_name = "";
      String last_name = "";
      String email = "";
      String id = "";
      try {
          first_name = object.getString("first_name");
          last_name = object.getString("last_name");
          email = object.getString("email");
          id = object.getString("id");
      } catch (JSONException e) {
          e.printStackTrace();
      }
  
      nameBox = (TextView)findViewById(R.id.txtFullName);
      emailBox = (TextView)findViewById(R.id.txtEmail);
      idBox = (TextView)findViewById(R.id.txtID);
  
      nameBox.setText(first_name+ " " +last_name);
      emailBox.setText(email);
      idBox.setText(id);
  
      ProfilePictureView profilePictureView;
  
      profilePictureView = (ProfilePictureView) findViewById(R.id.friendProfilePicture);
  
      profilePictureView.setProfileId(id);
  
  
  
  }
  
  @Override
  protected void onActivityResult(int requestCode, int resultCode, Intent data) {
      super.onActivityResult(requestCode, resultCode, data);
      callBackManager.onActivityResult(requestCode, resultCode, data);
  
  }
  
  }
  </code></pre>