title: Facebook LoginManager callback not called
body: <p>I am using Facebook sdk 4.1. I have the added the fb login button to a fragment and i set the code as below:</p>
  
  <pre><code>@Override
  public View onCreateView(LayoutInflater inflater, ViewGroup container,
                           Bundle savedInstanceState) {
  
      View view= inflater.inflate(R.layout.fragment_login, container, false);
  
      LoginButton loginButton = (LoginButton) view.findViewById(R.id.login_button);
      loginButton.setReadPermissions(Arrays.asList("public_profile", "email",
              "user_birthday", "user_about_me"));
  
      loginButton.setFragment(this);
  
  
      return view;
  }
  </code></pre>
  
  <p>Then on i have my activity like this</p>
  
  <pre><code>public class MainActivity extends AppCompatActivity {
  
      private CallbackManager callbackManager;
  
      private AccessTokenTracker accessTokenTracker;
  
      @Override
      protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          FacebookSdk.sdkInitialize(getApplicationContext());
          setContentView(R.layout.activity_main);
  
          callbackManager = CallbackManager.Factory.create();
  
          LoginManager.getInstance().registerCallback(callbackManager, new FacebookCallback&lt;LoginResult&gt;() {
              @Override
              public void onSuccess(LoginResult loginResult) {
                  Log.i("login","success");
              }
  
              @Override
              public void onCancel() {
                  Log.i("login","cancel");
              }
  
              @Override
              public void onError(FacebookException e) {
                  Log.i("login","error");
              }
          });
  
  
          accessTokenTracker = new AccessTokenTracker() {
              @Override
              protected void onCurrentAccessTokenChanged(
                      AccessToken oldAccessToken,
                      AccessToken currentAccessToken) {
                  // App code
                  if(currentAccessToken.isExpired()){
                      LoginManager.getInstance().logOut();
                  }
              }
          };
  
          AccessToken accessToken=AccessToken.getCurrentAccessToken();
  
          if(accessToken==null||accessToken.isExpired()){
              LoginManager.getInstance().logOut();
              getSupportFragmentManager().beginTransaction()
                      .replace(R.id.frame_container, new LoginFragment())
                      .commitAllowingStateLoss();
          }
  
      }
  
      @Override
      protected void onResume() {
          super.onResume();
  
      }
  
  
      @Override
      protected void onActivityResult(int requestCode, int resultCode, Intent data) {
          super.onActivityResult(requestCode, resultCode, data);
          callbackManager.onActivityResult(requestCode, resultCode, data);
      }
  
      @Override
      public boolean onCreateOptionsMenu(Menu menu) {
          // Inflate the menu; this adds items to the action bar if it is present.
          getMenuInflater().inflate(R.menu.menu_main, menu);
          return true;
      }
  
      @Override
      public boolean onOptionsItemSelected(MenuItem item) {
          // Handle action bar item clicks here. The action bar will
          // automatically handle clicks on the Home/Up button, so long
          // as you specify a parent activity in AndroidManifest.xml.
          int id = item.getItemId();
  
          //noinspection SimplifiableIfStatement
          if (id == R.id.action_settings) {
              return true;
          }
  
          return super.onOptionsItemSelected(item);
      }
  }
  </code></pre>
  
  <p>The proble is that callbackManager.onActivityResult(requestCode, resultCode, data); in onActivityResult method is called but LoginManager.getInstance().registerCallback(callbackManager, new FacebookCallback()... is never get called. why is that happening? </p>