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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T12:17:32+00:00 2026-06-18T12:17:32+00:00

I am not sure whether cache is the right term to use or not

  • 0

I am not sure whether “cache” is the right term to use or not but here goes my question, in my app i have an activity which loads JSON data from Internet and then populates a list view which seems to be working fine.

The real problem is the moment is loose Internet connection it starts showing a blank screen , is there any way i could keep on showing the old list view which was generated earlier in case there is no Internet connection and fetch the data only if there is persistent connection.

I know how to find whether there is net connection or not , so please do not write code for that my main concern is to save the previously loaded list views and display them if no connection found.

The only thing i can think of right now is making use of local sqlite database.

  • 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-18T12:17:33+00:00Added an answer on June 18, 2026 at 12:17 pm
    onResume()
    IF internet THEN request (AsyncTask?)
        Validate response and build Model objects from JSON
        IF objects are good THEN give objects to ListView adapter
    

    This way, your list will then be updated if and only if you have an internet connection.

    Why onResume() and not onCreate()? When you come back from another activity, the activity onResume() itself 😉

    For the user-friendly part, I do not know when you do this “update” but avoid doing it by yourself. Action bar (or menus) are here to let the user update data when he wants to.

    For the user-friendly part II. If you think the user MUST not play with you list while you are updating, disable events on that list or, if the user MUST not do anything (your app is to manipulate objects from that list), make use of a progress dialog to notify the user you are doing something

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

Sidebar

Related Questions

I'm not sure whether this question belongs on StackOverflow or SuperUser, but here goes
Not sure whether to ask this question here but here is the question. What
I am not sure whether I have described the question properly, but currently I
I am not sure whether distinct is the right word for this. I have
not sure whether I'm phrasing this question correctly but .. how do i get
I am not sure whether this forum is appropriate for this question. But, I
I'm not sure whether layout manager is the correct term, but i'm looking for
Not sure whether its a duplicate or not-why my left and right border are
I am not sure whether this only happens to me. Basically if I have
I'm not sure whether to post it here or at ServerFault. Anyway, I'm trying

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.