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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T09:32:29+00:00 2026-05-27T09:32:29+00:00

I have an application that updates the database every so often but as soon

  • 0

I have an application that updates the database every so often but as soon as I close the application or switch activities it stops updating. I assume that using a service class would help this problem but I do not know how have the service refresh my activity or just update the database. my question is how would I use a service to update my database? if it helps my database pulls in three strings into the database that is put in by the user.

  • 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-27T09:32:30+00:00Added an answer on May 27, 2026 at 9:32 am

    Yes, the best solution to make this continuously run is putting the task in a Service.

    Now as for your view updates, what API level are you using? If you’re using 3.x+, it’ll be beneficial for you to look into Loaders since those will update your view immediately on database changes.

    For all other API levels, one solution is to make the activities register as listeners to your service. Whenever the service completes a database update, send a message to all registered listeners of that service. However, when you’re doing this, you will have to make sure that you register the activity as a listener in onResume and unregister in onPause to avoid any null pointer situations.

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

Sidebar

Related Questions

I currently have a database that gets updated from a legacy application. I'd like
I have a windows forms application that reads and updates an XML file with
I have an application written in Delphi that adds / updates contacts in outlook.
I have a certain web application that makes upwards of ~100 updates to an
I need to create a plug-in that updates an application. Look, I have a
We have an application that takes real time data and inserts it into database.
I've a java web server application which updates objects to the database every 10
I have an application that performs a write to a database each time a
I have an Android application that installs a database (~2000 rows across all tables)
I have written a web application that interacts with Google calendar (adds/edits/updates events). You

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.