title: Facebook Session.StatusCallback never get called in fragment
body: <p>I'm developing an app that's have a FB authorization, I have a main activity(fragment activity) which provides to user to login by his name/password or by FB, when he click's the "login through FB" button he'll be moved to FB-auth fragment and now it works <strong>pretty good</strong> BUT somehow the <em>Session.StatusCallback</em> never get called, I've noticed this when I've tried to get User-data from FB. So for what reason it can be?</p>
  
  <p>Here is my FBFragment code:</p>
  
  <pre><code>public class FragmentLoginFacebook extends Fragment {
  
  private static final String TAG = FragmentLoginFacebook.class.getSimpleName();
  
  private UiLifecycleHelper uiHelper;
  
  private final List&lt;String&gt; permissions;
  
  @Override
  public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
      View view = inflater.inflate(R.layout.activity_for_fragments, container, false);
      Settings.addLoggingBehavior(LoggingBehavior.INCLUDE_ACCESS_TOKENS);
      Session session = Session.getActiveSession();
  
      if (session == null) {
          if (savedInstanceState != null) {
              session = Session.restoreSession(getActivity(), null, statusCallback, savedInstanceState);
          }
          if (session == null) {
              session = new Session(getActivity());
          }
          Session.setActiveSession(session);
      }
  
      if (!session.isOpened() &amp;&amp; !session.isClosed()) {
          session.openForRead(new Session.OpenRequest(this).setCallback(statusCallback).setPermissions(permissions));
      } else {
          Session.openActiveSession(getActivity(), this, true, statusCallback);
      }
  
      return view;
  }
  
  public FragmentLoginFacebook() {
      permissions = Arrays.asList("user_status", "email", "user_location", "user_birthday", "user_likes", "publish_actions");
  }
  
  @Override
  public void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      uiHelper = new UiLifecycleHelper(getActivity(), statusCallback);
      uiHelper.onCreate(savedInstanceState);
  }
  
  @Override
  public void onResume() {
      super.onResume();
  
      // For scenarios where the main activity is launched and user
      // session is not null, the session state change notification
      // may not be triggered. Trigger it if it's open/closed.
      Session session = Session.getActiveSession();
      if (session != null &amp;&amp; (session.isOpened() || session.isClosed())) {
          onSessionStateChange(session, session.getState(), null);
      }
  
      uiHelper.onResume();
  }
  
  @Override
  public void onActivityResult(int requestCode, int resultCode, Intent data) {
      super.onActivityResult(requestCode, resultCode, data);
      uiHelper.onActivityResult(requestCode, resultCode, data);
  
  }
  
  @Override
  public void onPause() {
      super.onPause();
      uiHelper.onPause();
  }
  
  @Override
  public void onDestroy() {
      super.onDestroy();
      uiHelper.onDestroy();
  }
  
  @Override
  public void onSaveInstanceState(Bundle outState) {
      super.onSaveInstanceState(outState);
      uiHelper.onSaveInstanceState(outState);
  }
  
  private void onSessionStateChange(Session session, SessionState state, Exception exception) {
      if (state.isOpened()) {
          Log.i(TAG, "Logged in...");
          Request.newMeRequest(session, new Request.GraphUserCallback() {
              @Override
              public void onCompleted(GraphUser user, Response response) {
                  if (user != null) {
                      Toast.makeText(getActivity(), "User is " + user.getUsername(), Toast.LENGTH_LONG).show();
                  }
              }
          });
      } else if (state.isClosed()) {
          Log.i(TAG, "Logged out...");
      }
  }
  
  private Session.StatusCallback statusCallback = new Session.StatusCallback() {
  
          //--&gt; Never get Called
      @Override
      public void call(Session session, SessionState state, Exception exception) {
  
          onSessionStateChange(session, state, exception);
  
      }
          //Cause i'd never seen a Login/Logout logcat messages from onSessionStateChange
  };
  </code></pre>
  
  <p>}</p>
  
  <p><strong>UPD:</strong>
  My activity class</p>
  
  <pre><code>public class ActivityLogin extends FragmentActivity {
  private Fragment mCurrentFragment;
  
  @Override
  protected void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.activity_for_fragments);
      if (savedInstanceState == null) {
          mCurrentFragment = new FragmentLoginMain();
          if(getSupportFragmentManager().findFragmentByTag("login") == null){
              getSupportFragmentManager().beginTransaction().add(R.id.fragmentLayout, mCurrentFragment, "login").commit();
          }
      }
  }
  </code></pre>
  
  <p>}</p>
  
  <p><strong>UPD#2</strong>
  By <strong>Roger Alien</strong> answer I've added in Activity</p>
  
  <pre><code>    @Override
      protected void onActivityResult(int requestCode, int resultCode, Intent data) {
          // TODO Auto-generated method stub
          super.onActivityResult(requestCode, resultCode, data);
           if (resultCode == Activity.RESULT_OK &amp;&amp; (requestCode &amp; 0xFFFF) == 0xFACE) { // if it was request to authorize facebook user
                  for (Fragment fragment : getSupportFragmentManager().getFragments()) { // transmit to all fragments? is it safe..? // TODO check logic
                      if (fragment != null) {
                          fragment.onActivityResult(requestCode &amp; 0xffff, resultCode, data);
                      }
                  }
              }
      }
  </code></pre>
  
  <p>STILL NOT WORKING!</p>