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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T10:33:53+00:00 2026-06-10T10:33:53+00:00

There are several tutorials on how to implement custom AsyncTaskLoaders but none I found

  • 0

There are several tutorials on how to implement custom AsyncTaskLoaders but none I found discusses how to handle data caching – in all of them the data are just loaded and delivered.

Can you give me some hints how to implement custom AsyncTaskLoader that would return cached versions of data immediatelly but at the same time request an update of the data and deliver the updated vesions of them as soon as they arrive? Is this even possible with Loaders or do I have to use another mechanism and which?

Background: I have an IntentService which accepts requests for data loading and delivers the results in broadcasts. I have an UI (ListView) that should display that data from ArrayAdapter or CrusorAdapter. I need some “caching” layer that would keep lastest known versions of the data to be displayed immediatelly but issue their update and re-display them as soon as new data arrives.

Although this could be done using dumb SQLite database for immediate versions and broadcast receiver for new data update, I’d give a preference to something that would make this “backgorund” data loading mechanism transparent like Loader-derived class IMHO could be.

  • 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-10T10:33:54+00:00Added an answer on June 10, 2026 at 10:33 am

    Yes, AsycnTask is the best way to do this. All you would do is write to your cache on the onPostExecute() of the AsyncTask. This could be done by creating a time stamp that compares data times and if there is a new time, use that data. Otherwise, you would have to compare all the data, and that can take precious time and resources, so it would depend on how much data you had.

    Here is a link that might help:

    http://developer.android.com/training/efficient-downloads/redundant_redundant.html

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

Sidebar

Related Questions

I have found several tutorials for older versions of Maya, but, since I am
I've read several tutorials for adding custom styles to the WYSIWYG (TinyMCE) editor. None
There are several threads on this here at SO but I didn't find one
There are several other questions about this topic that I have gone through, but
There are several variant questions on this on SO, but I did not find
There are so many plugins/gems but must of them have outdated documentation or no
I have been reading about dependency properties in several books but all have one
I am seriously confused about the Objective-C #import. I searched and found several tutorials
There are several tutorials that show you how to create 3d objects such as
I have been trying to get this to work with several tutorials/answers here, but

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.