title: Using facebook SDK on Android gives "User logged in as different Facebook user." error
body: <p>I'm upgrading my use of the Facebook SDK to the latest version. The following code is prety much lifted line by line from Facebook's own examples, which can be found here: <a href="https://developers.facebook.com/docs/facebook-login/android/v2.3" rel="noreferrer">https://developers.facebook.com/docs/facebook-login/android/v2.3</a></p>
  
  <pre><code>import android.content.Intent;
  import android.os.Bundle;
  import android.support.v4.app.FragmentActivity;
  import android.util.Log;
  
  import com.facebook.CallbackManager;
  import com.facebook.FacebookCallback;
  import com.facebook.FacebookException;
  import com.facebook.FacebookSdk;
  import com.facebook.login.LoginManager;
  import com.facebook.login.LoginResult;
  
  import java.util.Arrays;
  
  public class TestFb extends FragmentActivity{
  
      CallbackManager callbackManager;
      FacebookController fbController;
  
      @Override
      public void onCreate(final Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
  
      fbController = FacebookController.getInstance(this);
  
      FacebookSdk.sdkInitialize(getApplicationContext());
      final LoginManager loginManager = LoginManager.getInstance();
  
      callbackManager = CallbackManager.Factory.create();
      loginManager.registerCallback(callbackManager, new FacebookCallback&lt;LoginResult&gt;() {
              @Override
              public void onSuccess(LoginResult loginResult) {
                  String userId = loginResult.getAccessToken().getUserId();
                  String token = loginResult.getAccessToken().getToken();
                  Log.d("fb", "ID: " + userId + " Token: "+ token);
              }
  
              @Override
              public void onCancel() {
                  finish();
              }
  
              @Override
              public void onError(FacebookException e) {
                  Log.d("fb", "Exception: " + e.getMessage());
              }
          });
          loginManager.logInWithReadPermissions(this, Arrays.asList(new String[]{"email", "user_likes"}));
      }
  
      @Override
      protected void onActivityResult(int requestCode, int resultCode, Intent data) {
          super.onActivityResult(requestCode, resultCode, data);
          callbackManager.onActivityResult(requestCode, resultCode, data);
      }
  }
  </code></pre>
  
  <p>The problem is that this does not work when the user has already logged in to the facebook app on his phone. In that case, this gives a "User logged in as different Facebook user" error. </p>
  
  <p>I would think that given that there already is an active Facebook account on the device, a new one cannot be created. But if that was the case, should I get the user's ID and token from the existing account? I couldn't seem to be able to find any mention of this issue on Facebook's documentation pages.</p>