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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T11:02:35+00:00 2026-05-31T11:02:35+00:00

I use several maps to cache data in my activity. And when I manipulate

  • 0

I use several maps to cache data in my activity. And when I manipulate back to the activity the maps have been collected by the GC and throws out a nullpoint exception. So I should save these maps to avoid it.The problem is how can I do? just implement pacerable and put these data into the bundle? There is any other way to sovle this problem with graceful? Thanks for your replying with any help.

  • 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-31T11:02:36+00:00Added an answer on May 31, 2026 at 11:02 am

    If these are truly caches, simply reload the data from their original source as needed. That’s what a “cache” is for — optimizing access for a short period of time, with something else (e.g., a local file) being the backing store.

    You can choose the lifespan for your caches. Right now, they appear to be part of a single activity, which means if that activity is destroyed, the cache is destroyed. That may be appropriate, or it may not. You could also make the caches live for your entire process lifetime by making them static data members of some class. You need to be very careful that you do not introduce memory leaks this way, causing you to run out of heap space. But, in this case, the caches will live as long as the process does.

    However, eventually, the process will be terminated (e.g., user presses HOME and does not return to your application for a substantial period of time). That is why you need to be able to reload your caches from their original source as needed.

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

Sidebar

Related Questions

I have to use several SOAP messages to get data from a web service.
I use several forms on my site to send data to MySQL. Which is
In my ViewModels I use several DataAnnotations to validate the form data, there are
I have several constants that I use, and my plan was to put them
I want to use com.google.android.maps.MapView, but can't figure out how to download the library
I've been working on getting one of our web maps to print out in
In the application I'm developing, I make use of several maps associating strings to
I have several GWT Maps API JavaScriptObjects (LatLng, Polyline) which I want to send
I use several referenced tables with integer primary keys. Now I want to change
I use several user controls, along with standard ASP.Net controls, to build my webform.

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.