title: Facebook Android SDK 3.0 always returns OPENING when logging in
body: <p>I followed the instructions at <a href="https://developers.facebook.com/docs/howtos/androidsdk/3.0/login-with-facebook/">https://developers.facebook.com/docs/howtos/androidsdk/3.0/login-with-facebook/</a>. When I touch the "Log In"-button, the session state is OPENING - always. When I try to post a story to the user's wall I get an error stating </p>
  
  <blockquote>
    <p>"Session: an attempt was made to request new permissions for a session
    that has a pending request."</p>
  </blockquote>
  
  <p>Here is my code:</p>
  
  <pre><code>public class MainFragment extends Fragment {
      private static final String TAG = "MainFragment";
      private UiLifecycleHelper uiHelper;
  
      private Session.StatusCallback callback = new Session.StatusCallback() {
          @Override
          public void call(Session session, SessionState state,
                  Exception exception) {
              onSessionStateChange(session, state, exception);
          }
      };
  
      private void onSessionStateChange(Session session, SessionState state,
              Exception exception) {
          if (state.isOpened()) {
              Log.d(TAG, "Logged in...");
          } else if (state.isClosed()) {
              Log.d(TAG, "Logged out...");
          } else {
              Log.d(TAG, "Unknown state: " + state);
          }
      }
  
      @Override
      public void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          uiHelper = new UiLifecycleHelper(getActivity(), callback);
          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);
      }
  
      @Override
      public View onCreateView(LayoutInflater inflater, ViewGroup container,
              Bundle savedInstanceState) {
          View view = inflater.inflate(R.layout.facebook_login, container, false);
          LoginButton authButton = (LoginButton) view
                  .findViewById(R.id.authButton);
          authButton.setFragment(this);
  
          return view;
      }
  
      private boolean isSubsetOf(Collection&lt;String&gt; subset,
              Collection&lt;String&gt; superset) {
          for (String string : subset) {
              if (!superset.contains(string)) {
                  return false;
              }
          }
          return true;
      }
  
      private static final List&lt;String&gt; PERMISSIONS = Arrays
              .asList("publish_actions");
      private static final String PENDING_PUBLISH_KEY = "pendingPublishReauthorization";
      private boolean pendingPublishReauthorization = false;
  
      public void publishStory() {
          Session session = Session.getActiveSession();
  
          if (session != null) {
  
              // Check for publish permissions
              List&lt;String&gt; permissions = session.getPermissions();
              if (!isSubsetOf(PERMISSIONS, permissions)) {
                  pendingPublishReauthorization = true;
                  Session.NewPermissionsRequest newPermissionsRequest = new Session.NewPermissionsRequest(
                          this, PERMISSIONS);
                  session.requestNewPublishPermissions(newPermissionsRequest);
                  return;
              }
  
              Bundle postParams = new Bundle();
              postParams.putString("name", "Facebook SDK for Android");
              postParams.putString("caption",
                      "Build great social apps and get more installs.");
              postParams
                      .putString(
                              "description",
                              "The Facebook SDK for Android makes it easier and faster to develop Facebook integrated Android apps.");
              postParams.putString("link",
                      "https://developers.facebook.com/android");
              postParams
                      .putString("picture",
                              "https://raw.github.com/fbsamples/ios-3.x-howtos/master/Images/iossdk_logo.png");
  
              Request.Callback callback = new Request.Callback() {
                  public void onCompleted(Response response) {
                      JSONObject graphResponse = response.getGraphObject()
                              .getInnerJSONObject();
                      String postId = null;
                      try {
                          postId = graphResponse.getString("id");
                      } catch (JSONException e) {
                          Log.i(TAG, "JSON error " + e.getMessage());
                      }
                      FacebookRequestError error = response.getError();
                      if (error != null) {
                          Toast.makeText(getActivity().getApplicationContext(),
                                  error.getErrorMessage(), Toast.LENGTH_SHORT)
                                  .show();
                      } else {
                          Toast.makeText(getActivity().getApplicationContext(),
                                  postId, Toast.LENGTH_LONG).show();
                      }
                  }
              };
  
              Request request = new Request(session, "me/feed", postParams,
                      HttpMethod.POST, callback);
  
              RequestAsyncTask task = new RequestAsyncTask(request);
              task.execute();
          }
  
      }
  }
  </code></pre>
  
  <p>What's wrong?</p>
  
  <p>Edit: I'd also like to mention that the text on the "Log In"-Button doesn't change. I don't get an error while authenticating, but as far as I read it should change to "Log Out".</p>