Black screen after resume

Hi @ all,

I have a weird problem in my application.

When doing a display.save() in a scene, pressing home button on Android and resuming into app, the whole screen is black, all controls except native textfield are away.

If I remove the display.save()-line it works.

I am using composer.

Anyone had this issue before? Any ideas?

Best regards

yep / ditto / exactly.  it seems that display.save leaves some “remnant” in the display hierarchy, and on resume it tries to restore, but fails.  result = black screen you can’t remove (display.save returns no handle) except close/restart app.

just a couple days ago tweeted a workaround that seems to fix it for me.  don’t directly do display.save; instead do display.capture, grabbing the returned handle, then display.save that capture, then display.remove it.

hth

Thanks for your reply.

My problem is that I don’t want to save the whole screen rather than a group with some elements of the screen.

Is there any workaround, too?

Do you know if this is a composer issue or same problem with storyboard?

see captureBounds, passing it the .contentBounds of your group

i’m not using composer, haven’t noticed any dependency

Would not help me, too … there are overlayed elements I do not want in my image.

that’s as far as the workaround goes - tho i suppose you could try hiding all OTHER elements just prior to captureBounds?  (might be a lot of work, depending on how your code is structured)

time to file a bug?  i can at least confirm that it’s “not just you”

Oh boy, I feared to handle it manually the way you suggested.

Filled out a bugreport, I will let you know if / when there is a solution.

Please read our documentation:

http://docs.coronalabs.com/api/library/display/save.html

Android

When an app is suspended, the Android OS removes all OpenGL textures from memory. When the app is resumed, Corona must reload all images, but the capture image no longer exists in memory. You can’t use the display.save() function in Android applicationSuspend and applicationExit events because there are no OpenGL textures in memory to save.

Hey Tom,

thanks for your reply.

I do not save a picture on suspend / exit!

When you do a display.save() and suspend the app after a while and resume it, the whole screen is black.Corona did not load anything, no controls, nothing.

The save works fine and I have my picture saved locally. But - as said - after a call to display.save() we got the issue.

Best regards

Sent you a new and very minimezed sample app to reproduce the issue, Tom!

Thanks for your help

Here is a temporary bugfix, I added the following two lines of code after the display.save:

display.setDrawMode( “forceRender” )

timer.performWithDelay(1000, function() display.setDrawMode( “default” ) end )

yep / ditto / exactly.  it seems that display.save leaves some “remnant” in the display hierarchy, and on resume it tries to restore, but fails.  result = black screen you can’t remove (display.save returns no handle) except close/restart app.

just a couple days ago tweeted a workaround that seems to fix it for me.  don’t directly do display.save; instead do display.capture, grabbing the returned handle, then display.save that capture, then display.remove it.

hth

Thanks for your reply.

My problem is that I don’t want to save the whole screen rather than a group with some elements of the screen.

Is there any workaround, too?

Do you know if this is a composer issue or same problem with storyboard?

see captureBounds, passing it the .contentBounds of your group

i’m not using composer, haven’t noticed any dependency

Would not help me, too … there are overlayed elements I do not want in my image.

that’s as far as the workaround goes - tho i suppose you could try hiding all OTHER elements just prior to captureBounds?  (might be a lot of work, depending on how your code is structured)

time to file a bug?  i can at least confirm that it’s “not just you”

Oh boy, I feared to handle it manually the way you suggested.

Filled out a bugreport, I will let you know if / when there is a solution.

Please read our documentation:

http://docs.coronalabs.com/api/library/display/save.html

Android

When an app is suspended, the Android OS removes all OpenGL textures from memory. When the app is resumed, Corona must reload all images, but the capture image no longer exists in memory. You can’t use the display.save() function in Android applicationSuspend and applicationExit events because there are no OpenGL textures in memory to save.

Hey Tom,

thanks for your reply.

I do not save a picture on suspend / exit!

When you do a display.save() and suspend the app after a while and resume it, the whole screen is black.Corona did not load anything, no controls, nothing.

The save works fine and I have my picture saved locally. But - as said - after a call to display.save() we got the issue.

Best regards

Sent you a new and very minimezed sample app to reproduce the issue, Tom!

Thanks for your help