Home Button

I dont have any idea where o ask, but I think it not a hard question.

My app behavior seems like that: If I run, I can do all stuff there. But, **IF** the home button is pressed, I can see all icons in my iphone. Alter that, if I toutch my app button, seems to bem in the same point I left the game/app.

There is any way to do a behavior when the user exit the app, even if he come back later? I dont want my app starts in some point of the game.

I dont know if I make myself clear…

Thansk for any ideias…

Bruno [import]uid: 9133 topic_id: 24614 reply_id: 324614[/import]

In build.settings you need this;

[lua]UIApplicationExitsOnSuspend = false[/lua]

That will cause it to resume where it left off. If you want it to restart every time make it [lua]true[/lua].

Peach :slight_smile: [import]uid: 52491 topic_id: 24614 reply_id: 99720[/import]

Is this a relatively new option? A year ago I had to spend a lit of time writing state persistence code to ensure the app did this.
Does this option work if the app is exited and then forced out of memory by killing it in the iOS task switcher? (double home press) [import]uid: 8271 topic_id: 24614 reply_id: 99741[/import]

Its been there for at least 9 months. It came in when iOS 4.0 was first supported. [import]uid: 19626 topic_id: 24614 reply_id: 99769[/import]

Hi peach

Thanks. This was what I Was looking for.

If I can suggest something, I think Corona need some good tutorial about config.lua and build.settings in iOS and Android.

I dont think documentantion is enough to use this files(I dont like the documentation).

For example, I dont know (for sure) the diference between your solution and this:

http://developer.anscamobile.com/reference/index/eventtype-0

This is just an example.

Thnaks for your help.
Bruno

[import]uid: 9133 topic_id: 24614 reply_id: 99832[/import]

@Horace - am unsure on the memory Q, have to ask around and see if anyone knows for certain.

@bsdrago - what you link to is for you manually doing different things (like saving/loading/printing etc) on suspend, resume, exit, etc. Mine is just allowing the app to run in the background.

We do have some docs, they just need updating - we’re working on that, see latest blog post.

Peach :slight_smile: [import]uid: 52491 topic_id: 24614 reply_id: 100034[/import]

@horacebury

This option simply tells iOS to put the app in the background when it loses focus. If the app is killed by the OS or by the user, it will not save the games state. This still needs to be handled by you if you so desire.

All that work you did is still useful to some extent if you want to always resume a game in progress. Instead of saving the game’s state on suspend to mimic multitasking, you would execute the code on exit, if needed. [import]uid: 56820 topic_id: 24614 reply_id: 100366[/import]