Hi all,
I checked with the engineers on this, and I received the following summary:
Basically, when an Android app gets suspended, all OpenGL textures get dumped to clear memory for the next app’s textures. When an app gets resumed, all images and text have to get reloaded into OpenGL. This is a nuance of the Android operating system, not applicable to iOS.
Regarding your specific issue, if you do a “display.capture()”, your screenshot only exists in memory as a texture, which will be lost once you suspend the app. This means that there is no capture image file to load from when resuming your app. If you want your screen capture to “survive” a suspend/resume, you’ll need to use “display.save()” instead. This way, Corona has an image file to load from when resuming, thus recovering the captured image.
The advantage of the “display.capture()” API is that it’s faster than “display.save()” because it does not involve writing to file. The capture is done completely in memory. The disadvantage is what I’ve noted up above: the capture image does not survive a suspend/resume. So, “display.capture()” is best used for short live capture image, such as for screen transition effect.
Hope this helps,
Brent