title: FacebookCallback.onCancel is getting called when trying to login using facebook sdk
body: <p>I have an Android app and I am trying to use Facebook's SDK (version 4.1.0) to get a token and log in. Here is my code:</p>
  
  <pre><code>public class LoginActivity extends Activity {
      private CallbackManager callbackManager;
  
      @Override
      protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.activity_login);
          FacebookSdk.sdkInitialize(getApplicationContext());
  
          callbackManager = CallbackManager.Factory.create();
          LoginManager.getInstance().registerCallback(callbackManager, new FacebookCallback&lt;LoginResult&gt;() {
              @Override
              public void onSuccess(LoginResult loginResult) {
                  AccessToken accessToken = loginResult.getAccessToken();
                  Log.v(TAG, "Facebook login was successful");
                  String authToken = accessToken.getToken();
                  // User authToken here:
              }
  
              @Override
              public void onCancel() {
                  Log.v(TAG, "Facebook login was canceled");
              }
  
              @Override
              public void onError(FacebookException e) {
                  Log.e(TAG, "Facebook login failed: " + e.getMessage());
              }
          });
  
          Button facebook_button = (Button) findViewById(R.id.fbButton);
  
          facebook_button.setOnClickListener(new View.OnClickListener() {
              public void onClick(View v) {
                  LoginManager.getInstance().logInWithReadPermissions(getActivity(), Arrays.asList("public_profile"));
              }
          });
  
      }
  
      @Override
      public void onActivityResult(int requestCode, int resultCode, Intent data) {
          super.onActivityResult(requestCode, resultCode, data);
          callbackManager.onActivityResult(requestCode, resultCode, data);
      }
  }
  </code></pre>
  
  <p>The code switched to the Facebook app and back and <code>OnActivityResult()</code> is called. However, every time the callback method that is called is <code>onCancel()</code>. Note that I am not using the <code>LoginButton</code> provided by Facebook, and I have my own button (although I tried that approach and the result was the same). I double and triple checked my <em>app ID</em> and the <em>keyhash</em> generated by the app and they look correct too. So, I don't know what else may be wrong. Any help at this point is greatly appreciated.</p>