How to have app re-open to the state it was closed

Since a certain iOS update of the recent past, iPhone/ iPad apps seem to usually reopen in whichever state you closed them, letting you continue where you left off. Is this possible in Corona apps, perhaps using some building settings value? (I understand I can emulate this behavior by saving the whole state in a database and then recreating my sprites etc. during the next start, but I suspect there’s an easier way.)

Thanks!! [import]uid: 10284 topic_id: 11590 reply_id: 311590[/import]

As far as I know, I don’t think corona has added support for that feature yet. So far, I think you can only save the state yourself and reopen it. [import]uid: 11917 topic_id: 11590 reply_id: 42089[/import]

I’m still testing this on my app but I have the following in my build.settings file (make sure your corona build is up to date)

settings = {  
 iphone =  
 {  
 plist =  
 {  
 UIApplicationExitsOnSuspend = false   
 }  
 }  
}  

Then you might want to create an event listener for application suspend which links to your pause function or whatever to pause the state so it can be un-paused when resumed.

I have tested this and it seems ok at going out and back in as long as there’s not much background processing going on while its suspended. I still need to add the pause trigger on suspend too.

Hope this helps. [import]uid: 29676 topic_id: 11590 reply_id: 42096[/import]

Thanks so much! [import]uid: 10284 topic_id: 11590 reply_id: 42112[/import]