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 5978469
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T21:31:13+00:00 2026-05-22T21:31:13+00:00

I am using the Facebook SDK to post messages on walls. Now I need

  • 0

I am using the Facebook SDK to post messages on walls.

Now I need to fetch the Facebook friends list. Can anybody help me with this?

— Edit —

try {

  Facebook mFacebook = new Facebook(Constants.FB_APP_ID);
  AsyncFacebookRunner mAsyncRunner = new AsyncFacebookRunner(mFacebook);
  Bundle bundle = new Bundle();
  bundle.putString("fields", "birthday");
  mFacebook.request("me/friends", bundle);

} catch(Exception e){
    Log.e(Constants.LOGTAG, " " + CLASSTAG + " Exception = "+e.getMessage());
}

When I execute my activity, I’m not seeing anything, but in LogCat there is a debug message like:

06-04 17:43:13.863: DEBUG/Facebook-Util(409): GET URL: https://graph.facebook.com/me/friends?format=json&fields=birthday

And when I tried to access this url directly from the browser, I’m getting the following error response:

{
  error: {
  type: "OAuthException"
  message: "An active access token must be used to query information about the current user."
 }
}
  • 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-22T21:31:14+00:00Added an answer on May 22, 2026 at 9:31 pm

    You are about half way there. You’ve sent the request, but you haven’t defined anything to receive the response with your results. You can extend BaseRequestListener class and implement its onComplete method to do that. Something like this:

    public class FriendListRequestListener extends BaseRequestListener {
    
        public void onComplete(final String response) {
            _error = null;
    
            try {
                JSONObject json = Util.parseJson(response);
                final JSONArray friends = json.getJSONArray("data");
    
                FacebookActivity.this.runOnUiThread(new Runnable() {
                    public void run() {
                        // Do stuff here with your friends array, 
                        // which is an array of JSONObjects.
                    }
                });
    
            } catch (JSONException e) {
                _error = "JSON Error in response";
            } catch (FacebookError e) {
                _error = "Facebook Error: " + e.getMessage();
            }
    
            if (_error != null)
            {
                FacebookActivity.this.runOnUiThread(new Runnable() {
                    public void run() {
                        Toast.makeText(getApplicationContext(), "Error occurred:  " + 
                                        _error, Toast.LENGTH_LONG).show();
                    }
                });
            }
        }
    }
    

    Then in your request you can specify the request listener to use for receiving the response from the request, like this:

    mFacebook.request("me/friends", bundle, new FriendListRequestListener());
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using facebook-android-sdk to post messages to my wall. The following request: Bundle params
I can post plain text to wall using facebook c# sdk. But when i
I am using facebook javascript SDK to post comment on facebook and using this
With help of this post and this tutorial I have managed to integrate Facebook
I am using c# facebook sdk. I am trying to delete a facebook post
I'm using the Facebook iOS SDK to post videos from my app to the
I get exception when i try to post to facebook.I am using facebook sdk
Trying to post a status update using facebook php sdk. Code posted below. As
im using the js sdk to post message to friends wall from my website
i am creating a iphone application using Facebook SDK.I want to post message to

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.