Is it expected that Android's (AppCompat)ImageView...
# android
t
Is it expected that Android's (AppCompat)ImageViews do not cache drawable resources? We've got a page which has a fixed drawable background image (a 1920x1080 drawable) which can occur multiple times on the backstack. We kind of expected these drawables to be converted to a bitmap once and then reused, but that does not seem to happen. Given that each image is ~33MB decompressed in memory, we were looking at what are options were to make sure that this background only needs to be stored once. Is there any way to do this with the stock ImageViews or do we have to use Picasso/Glide? We'd prefer to use stock ImageViews as the drawables are currently specified directly in the xml layout files, which means that we can avoid the background "flickering" after it gets loaded asynchronously.
not kotlin but kotlin colored 2
I've just tested on a different device with a newer version of Android (an Android 11 Nvidia ShieldTV while the other device was a Fire TV Stick with a version comparable to Android 7 or 7.1) and the heap dump was drastically smaller on the ShieldTV (~70MB vs ~350MB in a comparable scenario). Does anyone know if this could be due to images being compressed in memory on newer versions of Android (or maybe being offloaded into VRAM)?
c
This is a workspace for the Kotlin Programming Language. Your general Android question should be posted somewhere else. Check out the channel description to find appropriate resources.
t
Sorry, my bad!
j
You could detach and re-attach your expensive view, too. Works of course only if it is visible only one.
It's what you'd normally do to keep videos running between screens
Also good for maps or other expansive views
e
I think this channel name should be rename
j
The enquirer understood that the question was asked in the wrong channel. No need to be passive aggressive internet police about it. If it is easy to help, why not simply help?