Caching generated QR Code
- by Michal K
I use zxing to encode a qr code and store it as a bitmap and then show it in ImageView. Since the image generation time is significant I'm planning to move it to a separate thread (AsyncTaskLoader will be fine I think).
The problem is - it's an image and I know that to avoid memory leaks one should never store a strong reference to it in an Activity.
So how would you do it? How to cache an image to survive config changes (phone rotation) and generally avoid generating it onCreate()?
Just point me in the right direction, please.