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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T08:36:57+00:00 2026-05-20T08:36:57+00:00

how can I listen, in an activity, to an event triggered in another activity?

  • 0

how can I listen, in an activity, to an event triggered in another activity?

More specifically, I created a menu with an activity to connect to facebook and get the user’s friends (as soon as the user is logged, the friend list is automatically and asynchronously requested and, on onComplete event, fills a global ArrayList). Say the user leaves the menu before the request is completed, and goes to another activity which shows the list of friends. To fill the list, I need to know if the getfriends request is complete and the ArrayList is filled. If it’s not, I need to know when it is done to start filling my list of friends. I’m not sure whether the asynchronous request is killed when leaving the activity, and, if not, how can I know it’s completed.

Can it be achieved?

Thank you

  • 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-20T08:36:57+00:00Added an answer on May 20, 2026 at 8:36 am

    OBSOLETE:

    The basis for inter-activity communication in Android is Intents, which, basically, is event-based (a)synchronous communication. I take it that the events you refer to may be anything that happens.

    You should probably just define an application specific Intent and fire it off at the activity with the listview when the Facebook API has completed its request.

    EDITED:

    …and, OK, you’re after something slightly different. Activities can and will be killed willy-nilly: this should leave asynch requests hanging (but I haven’t looked at the FB API’s, so I’m just guessing). I think what you are describing requires the Facebook request to be made from a Service within your application. Then you should be able just to use the basic Observable/Observers: declare a FriendObservable (simplest implementation: a global object or singleton) to which any Activity displaying friends can register itself. I think you should limit the lifetime of such a FriendService to Facebook API interactions, to minimize resource consumption.

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

Sidebar

Related Questions

Is there a way how modules can listen to parent application event? My current
I've a listView inside a FrameLayout Activity (not list Activity). I can listen to
I know how to listen to volume buttons in an activity. But can I
I'd like to build a small Python program that can listen to and analyze
my app is like an iPod for web articles. You can listen to the
Can I listen to Alert button click between components using AsyncToken? Basically, I want
How can I listen to data pushed by the server using http connection ?
I can use HttpListener to listen for requests coming from the same computer, but
I can't seem to find a way to listen for new producer and consumer
How can i bind a expressjs server to a specific IP Something like app.listen(8888,

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.