Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4599466
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T23:32:42+00:00 2026-05-21T23:32:42+00:00

Hi I am trying to add facebook connect to my Android app , I

  • 0

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:

{"error":{"type":"OAuthException","message":"An active access token 
must be used to query information about the current user."}}

CODE:

public class FacebookLogin extends Activity {

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();
    }

}
}

THe token I am getting is null.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-21T23:32:43+00:00Added an answer on May 21, 2026 at 11:32 pm

    You didn’t check if the session is valid or not.
    If not, then you have to authorize.

    You also have to sign in to Facebook the first time to use your app and give the permissions to the app.

    Then you will get the access token for the first time.

    Then you should store your session and when using the app again you will not get this error.

    To do so, please review the Example application LoginButton.java init() method from Facebook_Android_SDK

    Note: make a boolean flag stored in your sharedPreferences to indicate if this is the first time or not,
    so the login dialog doesn’t pop up every time you use the application.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to add facebook connect login to my phonegap/cordova app using the https://github.com/mgcrea/cordova-facebook-connect
I've been trying to add Facebook Connect to a website, but it didn't seem
I'm trying to add the facebook connect feature to my site, I decided to
Trying to add a blank sample app for a rails tutorial to GitHub, but
I am trying to add in the Facebook SDK binaries but I keep getting
I'm trying to add a Facebook Like button to a site but it never
I am trying to add the Facebook login button to my header, but for
I am trying to add facebook connect into my ASP.NET MVC I followed all
I'm trying to intergrate Facebook Connect into an GAE app. I've got a basic
I'm using Backbonejs for my app and I'm trying to add Facebook comments and

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.