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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T08:02:21+00:00 2026-05-27T08:02:21+00:00

I am working with Android Facebook SDK and wanted to get a friends list.

  • 0

I am working with Android Facebook SDK and wanted to get a friends list. I have created an “AsyncTask” for doing such a thing. I am pasting my doInBackgroundMethod here.

@Override
    protected String doInBackground(String... url) {
        String jsonResponse;
        try {
            jsonResponse =     Factory.getFacebook().request(Utils.LOGGEDIN_USER_FRIENDS);
        } catch (MalformedURLException e) {
            e.printStackTrace();
            return null;
        } catch (IOException e) {
            e.printStackTrace();
            return null;
        }
        return jsonResponse;
    }

Utils Code

public static final String LOGGEDIN_USER_FRIENDS = "me/friends";

The problem I am running in to is that it is returning an empty jsonResponse for the first time the application runs. When I open my app the second time I am getting the JsonResponse. But for the first time however I am getting empty jsonResponse.

Can any one help me out in this regard.

  • 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-27T08:02:22+00:00Added an answer on May 27, 2026 at 8:02 am

    Well it was easy… It was messed up by creating a String variable in a Factory. Later on, the same day I saw that, and called the AsyncTask built in method get which provides the result in the same thread.

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

Sidebar

Related Questions

I have the Facebook SDK for Android working in my app. I can't seem
I have just begun working with the Android SDK and I am having problems
I have working in Facebook for my app in Android. I have to use
I have implemented the facebook connect with android. It was working fine before but
I'm working on an Android app, specifically one that uses the Facebook Android SDK.
I have a lot of apps published using the FB android sdk github.com/facebook/facebook-android-sdk All
I'm currently working with Facebook official SDK for Android . I'm playing around with
I'm working on android app and trying to get created_time from facebook JSON .
I have Phonegap's Facebook plugin working perfectly within my Android app. This plugin uses
I've been working with the facebook-android-sdk and integrated posting a message to the user's

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.