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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T09:28:57+00:00 2026-06-04T09:28:57+00:00

To me is diffucult to understand which the right workflow is to download json

  • 0

To me is diffucult to understand which the right workflow is to download json data and show them in a ListView.
Currently i am using an AsyncTask to download and parse data that is shown using an ArrayAdapter. The problem is that AsyncTask doesn’t survive to activity restarts.

So I am wondering if services are a better solutionbut how to pass data to the ArrayAdapter? Should I always use the db as middle layer to store and retrieve data?

So which is better? AsyncTask in retained fragment or service using db?

Thanks

  • 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-04T09:28:58+00:00Added an answer on June 4, 2026 at 9:28 am

    I use a service to do http data retrieval and storage into sqlite db. Once the service has stored the data (or if there is a problem) I then fire a broadcast. My Fragments / Activities listen for these defined broadcasts and then act appropriately.

    I find that this is a very clean solution and avoids the problems of leaking asynctask references on activity teardown / rotation etc.

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

Sidebar

Related Questions

I understand that using postgres on osx is a little difficult because it has
My single-page javascript app retrieves data in JSON format via REST calls. Dates come
Currently we have several defect and bug tracking systems, which include Quality Centre and
I'm currently working on a performance critical application which incorporates legacy c code (a
Hi all patient developers using spring data graph. Since there is so less documentation
I know this question is difficult to understand but I need a mathematical equation
first of all I apologize if my question is difficult to understand. I'm having
One of the most difficult things about understand Spring is that Spring supports multiple
I think one of the more difficult concepts to understand in the Zend Framework
This might be difficult to answer. I am trying to understand some codebase and

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.