black screen on my app if i go to home screen then back

hi, 

after install my app on andriod phone…

i have a problem on my app, if I exit to home screen then back to my app, it gives me a black screen and i need to close the app then run it again?

how can solve this issue 

You need to see what error messages are happening in the device’s console log. If you’re building from a Mac and if you let Corona install the app for you, your console log will be redirected to the Corona console log window and you can watch for errors happening there as long as you don’t click away the dialog box that says it was successfully installed and to not close the dialog until you’re done with the device’s console log.

On Windows, you will need to use “adb logcat” from the command line to see it, or it’s possible to use Android Studio to view the console log as well.  For more information on debugging see our debugging guide:

https://docs.coronalabs.com/guide/basics/debugging/index.html

Rob

There is no error , some person told me I need to add some code to save your data of app during suspended
But I don’t know how can I deal with it @Rob Miracle

You’re going to have to provide considerably more details about what you’re doing if that’s the case.  We know that graphics created with display.newSnapShot() and a few other dynamically created objects have to be recreated when coming back from being suspended, but most things like display.newImageRect(), display.newText() etc. do not need to be recreated.  An app returning from being suspended should have all data still in memory. Now if the app exits instead of suspending, then it’s possible that some data may need to be saved, again since I don’t know what you’re making, I’m talking things like current game level, current score, player’s name, progress, etc.

When you say there are no errors, are you saying that because you don’t see errors on the screen or have you looked through the console log?
 

Rob

The black screen does not come if I back in short time, but if I take a long time this issue it come

You need to see what error messages are happening in the device’s console log. If you’re building from a Mac and if you let Corona install the app for you, your console log will be redirected to the Corona console log window and you can watch for errors happening there as long as you don’t click away the dialog box that says it was successfully installed and to not close the dialog until you’re done with the device’s console log.

On Windows, you will need to use “adb logcat” from the command line to see it, or it’s possible to use Android Studio to view the console log as well.  For more information on debugging see our debugging guide:

https://docs.coronalabs.com/guide/basics/debugging/index.html

Rob

There is no error , some person told me I need to add some code to save your data of app during suspended
But I don’t know how can I deal with it @Rob Miracle

You’re going to have to provide considerably more details about what you’re doing if that’s the case.  We know that graphics created with display.newSnapShot() and a few other dynamically created objects have to be recreated when coming back from being suspended, but most things like display.newImageRect(), display.newText() etc. do not need to be recreated.  An app returning from being suspended should have all data still in memory. Now if the app exits instead of suspending, then it’s possible that some data may need to be saved, again since I don’t know what you’re making, I’m talking things like current game level, current score, player’s name, progress, etc.

When you say there are no errors, are you saying that because you don’t see errors on the screen or have you looked through the console log?
 

Rob

The black screen does not come if I back in short time, but if I take a long time this issue it come