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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T12:26:35+00:00 2026-06-10T12:26:35+00:00

Looks like a familiar question. But i could not get a perfect solution, hence

  • 0

Looks like a familiar question. But i could not get a perfect solution, hence this question.

In my application i am fetching a data of 30k strings and storing it in a String Array. Since it takes a lot of time to fetch this data from a web server, i am performing this action in the background and showing a splash screen in the UI thread till then.

So this Array of strings is created and populated in SplashActivity and made Public Static. And i am using this in the next activity named ListViewActivity, just like this:

SplashActivity.myArrayOfStrings;

Here the problem is when i am in ListViewActivity and i press Home button, leave it for 3-5 mins and try to reopen the app, it says ArrayIndexOutOfBoundsException because that Array items in SplashActivity are destroyed and i am trying to access its values in the ListViewActivity.

So i what to know how i can store such data to use it in all the Activities with only 1 time fetching.

I don’t want anything like a Shared Preference because there 30k Strings will change every day.

I never used SQLite in my app, but if i store the Strings in a DataBase while i am in SpalshActivity can i use the data in every other Activity? I mean will this data be there even when my app goes to background and reopened 5 mins later??

Or is there any better and obvious solution??

Thank You

  • 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-10T12:26:37+00:00Added an answer on June 10, 2026 at 12:26 pm

    Storing so many datas must be done in a SQLite DB. You should not rely on any data store in an activity class to be permanent, because the activities will be recycled at will by the system (and then have a higher probability to, if the memory is low…)

    On the contrary, the data stored in SQLite are supposed to be permanent, even if you close your activity, your app, or even if you shut-off your phone.

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

Sidebar

Related Questions

Looks like this question has been asked thousand times already, but each person's configuration
I've this familiar question that looks like permutation/combination of the Math world. How can
This may look like an easy question for some of you, but I'm not
Looks like a dumb question, but I tried the following (where Me is a
Looks like XSD.exe is not delivered as a part of Visual Studio 2010. what
Looks like the options are Propel, Doctrine, and ActiveRecord, others?, but I am only
It looks like this block directly flushes the output. What's the practical use of
I posted about this sort of earlier, but I am not sure how to
Ok...I am new to rails so this may be a stupid question but need
I'm relatively(read: stupid newbie) familiar with disassembly but this bit stumped me: I have

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.