title: Facebook CallbackManager is unable to call registeredCallback
body: <p>I am trying to integrate FB Graph API to enable user to share the content on their FB wall.</p>
  
  <p>On app launch user can login using the facebook button (LoginButton) which only uses read permission (to get the user name and picture).</p>
  
  <p>Next when the user want to post a picture on their wall using my app; I create another instance of LoginButton and an instance to CallbackManager interface, then attach some code to that callbackManager (Code given below).</p>
  
  <pre><code>final LoginButton mLoginButton = new LoginButton(this);
  mLoginButton.setPublishPermissions("publish_actions");
  mPublishHandler = CallbackManager.Factory.create();
  if (mPublishHandler != null) {
      mLoginButton.registerCallback(mPublishHandler, new FacebookCallback&lt;LoginResult&gt;() {
  
          @Override
          public void onSuccess(LoginResult result) {
              // post picture code
          }
  
          @Override
          public void onError(FacebookException error) {
              Toast.makeText(MainScreen.this, error.getMessage(), Toast.LENGTH_LONG).show();
          }
  
          @Override
          public void onCancel() {
              Toast.makeText(MainScreen.this, "fb login was canceled", Toast.LENGTH_LONG).show();
          }
      });
  }
  </code></pre>
  
  <p>and the callback is invoked in the onActivityResult() method</p>
  
  <pre><code>if (mPublishHandler != null) {
      mPublishHandler.onActivityResult(requestCode, resultCode, data);
  }
  </code></pre>
  
  <p>My problem is that when I tried to use the on the fly login button with publish permission; the facebook sdk cannot find the callback I set with even though it is returning success.</p>
  
  <pre><code>08-10 02:27:58.972: D/FacebookSDK.Response(4992): Response (raw)
  08-10 02:27:58.972: D/FacebookSDK.Response(4992):   Size: 16
  08-10 02:27:58.972: D/FacebookSDK.Response(4992):   Response:
  08-10 02:27:58.972: D/FacebookSDK.Response(4992): {"success":true}
  </code></pre>
  
  <p>So, I tried to track the issue and find this problem occurring within the FB SDK -
  (inside onActivityResult@com.facebook.internal.CallbackManagerImpl)</p>
  
  <pre><code>public boolean onActivityResult(int requestCode, int resultCode, Intent data) {
      Callback callback = callbacks.get(requestCode);
      if (callback != null) {
          return callback.onActivityResult(resultCode, data);
      }
      return runStaticCallback(requestCode, resultCode, data);
  }
  </code></pre>
  
  <p>Here the callback is a hashmap which facebook is probably using for storing callback instances(V) against requestCode(K). But I am getting requestCode as 64207 while checking the callback hashmap I can see that there is indeed an instance with key value 64206. Thus returning callback as null.</p>
  
  <p>Any indication or hint is appreciated, thanks in advance.</p>