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

  • Home
  • SEARCH
  • 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 8474603
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T17:40:24+00:00 2026-06-10T17:40:24+00:00

Possible Duplicate: ViewPager Activity to notify a Fragment of a specific event I am

  • 0

Possible Duplicate:
ViewPager Activity to notify a Fragment of a specific event

I am experimenting with using fragments and I ran into this problem.
I have a service running in the background which I want to update a listview in a fragment.
First I just wanted to have the fragment listen for a broadcast, but it seems like registerReceiver is not allowed in a fragment?
How do I do this. Do I need to listen for a broadcast in the main activity and then somhow send it to the fragment?

  • 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-10T17:40:25+00:00Added an answer on June 10, 2026 at 5:40 pm

    I’d use the activity for this. Google has some good examples and description of the topic fragment and activity communication. You can read about it here: http://developer.android.com/training/basics/fragments/communicating.html

    In short, fragments use listeners to communicate with activities and activities just use public methodes in fragments.

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

Sidebar

Related Questions

Possible Duplicate: ViewPager and fragments — what's the right way to store fragment's state?
Possible Duplicate: Can main function call itself in C++? I found this problem very
Possible Duplicate: Convert numeral date(03-11-1991) into arabic no(۱۹۹۱/۱۱/۰۳) php This is my client's requirement.
Possible Duplicate: ViewPager as a circular queue / wrapping I have three fragment classes
Possible Duplicate: Java Wait and Notify: IllegalMonitorStateException What is the problem with private final
Possible Duplicate: How do I make a request using HTTP basic authentication with PHP
Possible Duplicate: How can I understand nested ?: operators in PHP? Why does this:
Possible Duplicate: gesture issue with mapview in viewpager page I use the template that
Possible Duplicate: Reference - What does this symbol mean in PHP? I am looking
Possible Duplicate: Reducing the space between sections of the UITableView Im using UITableView of

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.