title: Android Facebook .. how to get AccessToken
body: <p>Hi I am trying to add facebook connect to my Android app , I did managed to post on my wall with app but when I downloaded android facebook app and logged in on it but now I cant post on my wall. I am getting this error:</p>
  
  <pre><code>{"error":{"type":"OAuthException","message":"An active access token 
  must be used to query information about the current user."}}
  </code></pre>
  
  <p><strong>CODE:</strong></p>
  
  <p>public class FacebookLogin extends Activity {</p>
  
  <pre><code>private static final String APP_API_ID = "080808998-myappId";
  Facebook facebook = new Facebook(APP_API_ID);
  private AsyncFacebookRunner mAsyncRunner;
  
  public void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.main);    
  
      mAsyncRunner = new AsyncFacebookRunner(facebook);
  
      SessionStore.restore(facebook, this);
      SessionEvents.addAuthListener(new SampleAuthListener());
      Log.i("Error", facebook.getAccessToken()+"tokenId");
      facebook.dialog(FacebookLogin.this, "feed", new SampleDialogListener());
  
  }
  
  public void postOnWall(String msg) {
      try {
             Bundle bundle = new Bundle();
             bundle.putString("message", msg);
             bundle.putString("from", "fromMe");
             bundle.putString("link","facebook.com");
             bundle.putString("name","name of the link facebook");
             bundle.putString("description","some description here");
  
             //bundle.putString(Facebook.TOKEN, accessToken);
  
             bundle.putString("picture", "http://url to image");
             String response = facebook.request("me/feed",bundle,"POST");
  
             Log.d("Error", "got response: " + response);
             if (response == null || response.equals("") || 
                     response.equals("false")) {
                Log.v("Error", "Blank response");
             }
      } catch(Exception e) {
          e.printStackTrace();
      }
  </code></pre>
  
  <p>}
  }</p>
  
  <p>THe token I am getting is null.</p>