persistence - Android - Where to store generated bitmaps? -


I got an app that dynamically moves around the screen for a user to get 6 to 100 small bitmaps Generates the given session I currently make them in onCreate and store them on the SD card, so that after changing an orientation I can drag them out of external storage and display them again. Can I However, it takes time (loading) and I want to keep bitmap references between spouse changes for fast reach.

My question is, is there a better place to store my generated bitmaps? I was thinking about building a stable storage library in my base activity, something that only the app needs to fully reload from memory (shutdown, other applications require resources, 30 minutes restart, etc.) would be required.

Ideally, I want to be able to get the user back on the title screen, click the "Resume" button, and I have just got it in onCreate Rather than being used for those resident bitmap references instead of loading them again by storage, I do not think that activity Then CNN configuration instance I need it.

Alternatively, what I'm doing is a better way to handle bitmaps generated more than I have been told about the plan?

Surely about keeping a bitmap generated on orientation changes about the Roman cow, see Sounds like an almost identical case. It summarizes, you can use onRetainNonConfigurationInstance / getLastNonConfigurationInstance to pass / obtain an arbitrary object in the orientation-related activity destruction. Although this method will not help you start and then start.

You can order bitmap in a static cache-object (possibly a reference to a class on a soft reference hashmap), but be careful not to store durables or scenes, in reference to their active activity. Can be born. It continues for the life of the entire application, but I want to avoid it, if possible, due to any global situation, ugly problems can occur and the memory leak can be difficult to find where things are seen as activity examples Are referring to


Comments

Popular posts from this blog

windows - Heroku throws SQLITE3 Read only exception -

lex - Building a lexical Analyzer in Java -

python - rename keys in a dictionary -