title: Facebook wall post from multiple Activities
body: <p>I have been trying to make wall post from multiple pages but when i try to make post from other pages except original facebook page, it is giving me an exception of java.lang.NullPointerException</p>
  
  <p>The method i am calling and created in a Facebook page.</p>
  
  <pre><code> public void setConnection() {
      mContext = this;
      mFacebook = new Facebook(getResources().getString(R.string.FACEBOOK_ID_TEST));
      mAsyncRunner = new AsyncFacebookRunner(mFacebook);
  
  }
  
  public boolean isSession() {
      sharedPrefs = PreferenceManager.getDefaultSharedPreferences(mContext);
      String access_token = sharedPrefs.getString("access_token", "x");
      Long expires = sharedPrefs.getLong("access_expires", -1);
      Log.d(TAG, access_token);
  
      if (access_token != null &amp;&amp; expires != -1) {
              mFacebook.setAccessToken(access_token);
              mFacebook.setAccessExpires(expires);
      }
  
      return mFacebook.isSessionValid();
  </code></pre>
  
  <p>}</p>
  
  <pre><code>public void getID()
  {
  
      Bundle bundle = new Bundle();
      bundle.putString("fields", "birthday");
      try {
          mFacebook.request("me/friends", bundle);
      } catch (MalformedURLException e) {
          // TODO Auto-generated catch block
          e.printStackTrace();
      } catch (IOException e) {
          // TODO Auto-generated catch block
           Log.e("Error in FaceBook Friends List","Exception = "+e.getMessage());
          e.printStackTrace();
      }
       if (isSession()) {
               Log.d(TAG, "sessionValid");
              try {
                  mFacebook.request("me/friends", bundle);
              } catch (MalformedURLException e) {
                  // TODO Auto-generated catch block
                  e.printStackTrace();
              } catch (IOException e) {
                  // TODO Auto-generated catch block
                   Log.e("Error in FaceBook Friends List","Exception = "+e.getMessage());
                  e.printStackTrace();
              }
       } else {
               // no logged in, so relogin
               Log.d(TAG, "sessionNOTValid, relogin");
               mFacebook.authorize(this, PERMISSIONS, new LoginDialogListener());
       }
  }
  </code></pre>
  
  <p>I am able to get the wall post dialog box but its showing "An error occurred. Please try again later".</p>
  
  <p>Please help me out.
  Thanks in advance.</p>