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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T14:04:55+00:00 2026-06-09T14:04:55+00:00

I am trying to fetch facebook user’s likes in android . I succeeded in

  • 0

I am trying to fetch facebook user’s likes in android . I succeeded in fetching the likes using graph api, but could not find a way how to enable notification mechanism so that it updates the UI.

public class A{
  // Holds all the facebook related information here.

    public void fetchLikes(){
      mAsyncRunner.request( "me/likes", new RequestListener() {

         @Override
         public void onComplete(String response, Object arg1) {

           //update the liked pages to database here.
         }

      }
    }

 }


public class B{

  public void afterLogin(){
    A a = new A();
    a.fetchLikes(); // Problem is after here.
    updateUI();

  }

   public void updateUI(){
    //updating UI here
   }
}

As the facebook fetching is done on its own facebook async runner.I could not make a solution to send a notification back to the caller.
In above case after calling the a.fetchLikes(), it is updating my local DB. But before the process is completed updateUI() is getting called and trying to update my activity.

Please guys, could you offer a way to solve this problem. I need something to notify me after the process is done.

Thanks,
Vijay

  • 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-06-09T14:04:56+00:00Added an answer on June 9, 2026 at 2:04 pm

    It looks like you want to call updateUI() from the onComplete() handler of the AsyncRunner, (Assuming onComplete() is called from the UI thread. I am not familiar with Facebook’s AsyncRunner class.)

    I would accomplish this by making fetchLikes() take in some interface, from which I could pass in a call to updateUI().

    public class A {
        public void fetchLikes(OnFetchLikesComplete callback){
            mAsyncRunner.request( "me/likes", new RequestListener() {
    
            @Override
            public void onComplete(String response, Object arg1) {
                callback.onComplete(response, arg1);
            }
    
        }
    
        public interface OnFetchLikesComplete {
            void onComplete(String response, Object arg1);
        }
    }
    

    Then, you can just create an anonymous inner class in B to call to updateUI().

    public class B {
        public void afterLogin(){
            A a = new A();
            a.fetchLikes(new A.OnFetchLikesComplete() {
                public void onComplete(String response, Object arg1) {
                    updateUI();
                }
            });
        }
    
        public void updateUI(){
            //updating UI here
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to fetch Wikipedia pages using LWP::Simple , but they're not coming back.
So I'm trying to simply fetch the user's profile photo from facebook but I'm
I'm trying to fetch albums list from facebook via JavaScript and Graph API. I'm
I've been trying to get Rails to play with the new Facebook Graph API.
I'm trying to familiarize myself with Facebook's new Graph API and so far I
I am trying to get the access_token for a user using the FB API
I am trying to create a facebook like website here http://likes.vermilionsite.com/ but when you
I trying to fetch the time from the phone's clock but am not able
I am trying to Fetch GPS continuously every minute using Android Code. When it
I am trying to fetch the profile feed from a user's facebook. For this

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.