title: How can I use the LoginManager class from FacebookSDK inside a Fragment?
body: <p>It looks like the LoginManager from the FacebookSDK contains a method only with an android.support.v4.app.Fragment parameter, and none with android.app.Fragment. Unfortunately, v4.app.Fragment is not an option for me. I have tried doing the same thing in an Activity and in an v4.app.Fragment, and it works. However, I cannot use either of those.</p>
  
  <pre><code>private void init() {
      callbackManager = CallbackManager.Factory.create();
      loginManager = LoginManager.getInstance();
  
      loginManager.registerCallback(callbackManager,
              new FacebookCallback&lt;LoginResult&gt;() {
                  @Override
                  public void onSuccess(LoginResult loginResult) {
                      onLoginSuccess(loginResult);
                  }
  
                  @Override
                  public void onCancel() {
                      onLogInFailed();
                  }
  
                  @Override
                  public void onError(FacebookException e) {
                      onLogInFailed();
                  }
              });
  }
  
  private void logIn() {
      Global.log("logging in to facebook");
      Collection&lt;String&gt; permissions = Arrays.asList("public_profile", "email");
      loginManager.logInWithReadPermissions(getActivity(), permissions);
  }
  
  @Override
  public void onActivityResult(int requestCode, int resultCode, Intent data) {
      super.onActivityResult(requestCode, resultCode, data);
      callbackManager.onActivityResult(requestCode, resultCode, data);
  }
  </code></pre>
  
  <p>The method in question is loginManager.logInWithReadPermissions, that can take either an activity or a v4.app.Fragment as a parameter, but not the type of Fragment i need.</p>
  
  <p>Can anyone help?</p>