title: Got error 101, "invalid application id" at Android Facebook Logout
body: <p>I have a class which extends <code>ListFragment</code>. My<code>loginToFacebook()</code>method (see below) works. But once I want to logout and call <code>logoutFromFacebook()</code>, I receive the following error:   </p>
  
  <pre><code>{"error_code":101,"error_msg":"Invalid application ID.","request_args":[{"key":"method","value":"auth.expireSession"},{"key":"format","value":"json"}]}
  </code></pre>
  
  <p>Here are my methods:</p>
  
  <pre><code>public void loginToFacebook() {
  
          mPrefs = getPreferences(MODE_PRIVATE);
          String access_token = mPrefs.getString("access_token", null);
          long expires = mPrefs.getLong("access_expires", 0);
  
          if (access_token != null) {
              facebook.setAccessToken(access_token);
  
              btnFbLogin.setVisibility(View.INVISIBLE);
  
              // Making get profile button visible
              btnFbGetProfile.setVisibility(View.VISIBLE);
  
              // Making post to wall visible
              btnPostToWall.setVisibility(View.VISIBLE);
  
              // Making show access tokens button visible
              btnShowAccessTokens.setVisibility(View.VISIBLE);
  
              btnLogout.setVisibility(View.VISIBLE);
  
              Log.d("FB Sessions", "" + facebook.isSessionValid());
          }
  
          if (expires != 0) {
              facebook.setAccessExpires(expires);
          }
  
          if (!facebook.isSessionValid()) {
              facebook.authorize(getActivity(),
                      new String[] { "email", "publish_stream" },
                      new DialogListener() {
  
                          @Override
                          public void onCancel() {
                              // Function to handle cancel event
                          }
  
                          @Override
                          public void onComplete(Bundle values) {
                              // Function to handle complete event
                              // Edit Preferences and update facebook acess_token
                              SharedPreferences.Editor editor = mPrefs.edit();
                              editor.putString("access_token",
                                      facebook.getAccessToken());
                              editor.putLong("access_expires",
                                      facebook.getAccessExpires());
                              editor.commit();
  
                              // Making Login button invisible
                              btnFbLogin.setVisibility(View.INVISIBLE);
  
                              // Making logout Button visible
                              btnFbGetProfile.setVisibility(View.VISIBLE);
  
                              // Making post to wall visible
                              btnPostToWall.setVisibility(View.VISIBLE);
  
                              // Making show access tokens button visible
                              btnShowAccessTokens.setVisibility(View.VISIBLE);
  
                              btnLogout.setVisibility(View.VISIBLE);
                          }
  
                          @Override
                          public void onError(DialogError error) {
                              // Function to handle error
  
                          }
  
                          @Override
                          public void onFacebookError(FacebookError fberror) {
                              // Function to handle Facebook errors
  
                          }
  
                      });
          }
      }
  </code></pre>
  
  <p>//---------------------------//</p>
  
  <pre><code>public void logoutFromFacebook() {
          mAsyncRunner.logout(getActivity(), new RequestListener() {
              @Override
              public void onComplete(String response, Object state) {
                  Log.d("Logout from Facebook", response);
                  if (Boolean.parseBoolean(response) == true) {
                      runOnUiThread(new Runnable() {
  
                          @Override
                          public void run() {
                              // make Login button visible
                              btnFbLogin.setVisibility(View.VISIBLE);
  
                              // making all remaining buttons invisible
                              btnFbGetProfile.setVisibility(View.INVISIBLE);
                              btnPostToWall.setVisibility(View.INVISIBLE);
                              btnShowAccessTokens.setVisibility(View.INVISIBLE);
                              btnLogout.setVisibility(View.INVISIBLE);
                          }
  
                      });
  
                  }
              }
  
              @Override
              public void onIOException(IOException e, Object state) {
              }
  
              @Override
              public void onFileNotFoundException(FileNotFoundException e,
                      Object state) {
              }
  
              @Override
              public void onMalformedURLException(MalformedURLException e,
                      Object state) {
              }
  
              @Override
              public void onFacebookError(FacebookError e, Object state) {
              }
          });
      }
  </code></pre>
  
  <p>I just wonder if the cause of the problem is <code>extends ListFragment</code>, because when I tried with <code>extends Activity</code>, it runs well.</p>
  
  <p>Would someone out there help me out to solve this problem? any helps would be appreciated.</p>
  
  <p>Thank you</p>