title: Android Facebook SDK 4.0 login with LoginManager
body: <p>I am trying to migrate login code of an old application from SDK 3.0 to SDK 4.0.
  I have implemented the Login using the <code>LoginManager</code>, as I have custom Login buttons.</p>
  
  <p>The problem is that I get no response from the Facebook API. No success, no error, no exception thrown whatsoever. The code is as below:</p>
  
  <pre><code>    //global refs
      //callbacks
      private CallbackManager mCallbackManager;
      private FacebookCallback&lt;LoginResult&gt; mFacebookCallback;
  
      private List&lt;String&gt; mPermissions = Arrays.asList("email");
      private LoginManager mLoginMgr;
      private Activity mActivity;
  
      //........
  
      //code is inside method
      FacebookSdk.sdkInitialize(getApplicationContext());
  
      //perhaps a bit excessive
      FacebookSdk.addLoggingBehavior(LoggingBehavior.GRAPH_API_DEBUG_INFO);
      FacebookSdk.addLoggingBehavior(LoggingBehavior.DEVELOPER_ERRORS);
      FacebookSdk.addLoggingBehavior(LoggingBehavior.INCLUDE_ACCESS_TOKENS);
      FacebookSdk.addLoggingBehavior(LoggingBehavior.INCLUDE_RAW_RESPONSES);
      FacebookSdk.setApplicationId(mActivity.getString(R.string.sample_fb_id));
  
      //init callbacks
      mFacebookCallback = new FacebookCallback&lt;LoginResult&gt;() {
          @Override
          public void onSuccess(LoginResult loginResult) {
              Log.v("LoginActivity login", loginResult.toString());
              GraphRequest request = GraphRequest.newMeRequest(loginResult.getAccessToken(), new GraphRequest.GraphJSONObjectCallback() {
                  @Override
                  public void onCompleted(JSONObject object, GraphResponse response) {
                      // Application code
                      Log.v("LoginActivity", response.toString());
                      try {
                          String email = object.getString("email");
                          Log.v("LoginActivity", "obtained email: ", email);
                      } catch (JSONException e) {
                          e.printStackTrace();
                      }
                  }
              });
              request.executeAsync();
          }
          @Override
          public void onCancel() {
              Log.e("LoginActivity", "facebook login canceled");
          }
  
          @Override
          public void onError(FacebookException e) {
              Log.e("LoginActivity", "facebook login failed error");
          }
      };
      mCallbackManager = CallbackManager.Factory.create();
      mLoginMgr = LoginManager.getInstance();
      mLoginMgr.registerCallback(mCallbackManager, mFacebookCallback);
      mLoginMgr.logInWithReadPermissions(mActivity, mPermissions);
  </code></pre>
  
  <p>Using the <code>Debugger</code>, I am able to see that this line:
  <code>mLoginMgr.logInWithReadPermissions(mActivity, mPermissions);</code>
  gets executed, but none of the <code>callbacks</code> are ever triggered. I also have no errors in console, and the Device screen goes black and nothing happens.</p>
  
  <p>I don't think it matters, but the code is executed in a wrapper class (outside <code>Activity</code>). I tried inside the <code>Activity</code>, but it made no difference.</p>
  
  <p>Any suggestions?
  Much appreciated.</p>
  
  <p>Edit:</p>
  
  <p>This is declared inside <code>AndroidManifest.xml</code>:</p>
  
  <pre><code>&lt;activity android:name="com.facebook.FacebookActivity"
            android:theme="@android:style/Theme.Translucent.NoTitleBar"
            android:configChanges="keyboard|keyboardHidden|screenLayout|screenSize|orientation"
            android:label="@string/app_name" /&gt;
  </code></pre>