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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T16:05:20+00:00 2026-06-12T16:05:20+00:00

I have an android application that has a background service which polls a web

  • 0

I have an android application that has a background service which polls a web service for new information and writes it into a sqlite database for my application. The Application also has a list activity that displays the data from this sqlite database.

Basically I want the list to auto update while looking at it if new data comes into the sqlite database from the service writing to it. I could just provide a refresh button of sorts but it would be nice if it would auto update. Is there an easy way to do that? Should the service just fire an event that the listactivity subscribes to and invalidate the adapter? Or is there a way for the adapter to be based off of a cursor or something and automatically update when the underlying data changes? Just trying to architecturally think through this and want the best and most maintainable (and quick to develop) method. I’m curious if I’ve missed a possibility that would make this much easier.

By the way, I’m using Mono for Android (company policy, not my choice).

  • 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-12T16:05:21+00:00Added an answer on June 12, 2026 at 4:05 pm

    Basically I want the list to auto update while looking at it if new
    data comes into the sqlite database from the service writing to it.

    You could implement a dynamically registered BrodcastReceiver(in the onResume callback), in your Activity containing the list, that could listen for a custom broadcast. When this BroadcastReceiver receives the custom broadcast you would update the cursor, call notifyDataSetChanged, in other terms, referesh the list. Your Service will insert the new values in the database when it receives them and when it finishes that task it could send a broadcast, your custom broadcast to announce interested observers that new data is available. This will trigger the receiver in the Activity if the activity is in the foreground.

    I don’t know Mono for Android to give you some code but you should be able to implement something from the above idea.

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

Sidebar

Related Questions

I have an Android application that has a service that runs in the background,
I have an android application that has a button which I want to have
I'm developing an android application which uses background service. I have not had much
I have an android application that has 3 activites. For the 1st and 2nd
I have an Android app that has an Application class and I have another
I have an Android app, that is using the SIM Toolkit. The application has
Background: I am working on an Android Honeycomb (v3.0) application that has a requirement
I have a application in Android that has a broadcast receiver that clear any
I have an Android application that has a need to perform work in the
I know that Android doesn't have an Application-level onPause the way an Activity has

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.