Android app. Can we reuse images while we work?

We have an Android application that throws an error from memory on Android 1.6. It works fine 2.0. At the moment, we are trying to reduce memory usage during operation.

We were thinking about reusing images - for example, the background image of each screen. Is it possible to load a background image once into memory during application launch and reuse this cached copy on each screen, but not on each screen, loading the same background image, increasing the total area in RAM?

We understand that there are many other ways and recommendations for using memory while you work. But for now, we just wanted to find out if this "image reuse" approach is really possible?

If so, how can we do this? Will any memory be saved at all, or will the Android OS still create multiple copies of the same asset for each screen without getting any benefit from the memory perspective?

Thanks so much for your time reading my post.

+3
source share
2 answers

Drawable , Drawables. , , , .

+2

, .

ListViews, .

getView(), .

onCreate() , .

, .

, 2009 / Google , . . , Bitmap.

0

Source: https://habr.com/ru/post/1775716/


All Articles