Os.exit() app still runs in background

I have the following:
local button2 =
display.newImage(“Aixam.png”)
button2.x = 150
button2.y = 350
button2:scale(.25,.25)

local exit2 = function(event)
os.exit()
return true
end

button2:addEventListener(
“touch”, exit2 )

On Iphone 4 I click the button and the app closes but still appears when d/clicking the home button.
If i run the app again the app is in it’s ‘new state’.

How do I stop this please?

ie completely close the app. [import]uid: 4585 topic_id: 4914 reply_id: 304914[/import]

iOS 4 will always keep the app down in the tray, regardless of whether or not the app supports multitasking. [import]uid: 8782 topic_id: 4914 reply_id: 15875[/import]

Remove the displayobject and remove the eventlistener before you exit. [import]uid: 5712 topic_id: 4914 reply_id: 15878[/import]

does Removing the displayobject and remove the eventlistener before exiting work? [import]uid: 89663 topic_id: 4914 reply_id: 67196[/import]

Apple will often reject apps using os.exit() - it’s not designed to be used with a button to quit the app.

Peach [import]uid: 52491 topic_id: 4914 reply_id: 67245[/import]

what should you use as a button to quit the app, or what is the best way to exit your app? [import]uid: 89663 topic_id: 4914 reply_id: 67246[/import]

The best way is to wait for the user`s feeling to push the iDevice Home Button and get out your app.

:slight_smile:

[import]uid: 89165 topic_id: 4914 reply_id: 67248[/import]

i thought you were being sarcastic, but after some googling i found this

"On the iPhone there is no concept of quitting an app. The only action that should cause an app to quit is touching the Home button on the phone, and that’s not something developers have access to.

According to Apple, your app should not terminate on its own. Since the user did not hit the Home button, any return to the Home screen gives the user the impression that your app crashed. This is confusing, non-standard behavior and should be avoided."

http://stackoverflow.com/questions/355168/proper-way-to-exit-iphone-application

[import]uid: 89663 topic_id: 4914 reply_id: 67250[/import]

Exactly that!

PS: Would not be anything like sarcastic with any member here.
Regards, [import]uid: 89165 topic_id: 4914 reply_id: 67252[/import]

Good info for this thread, thanks for sharing the link ezraanderson :slight_smile:

Peach [import]uid: 52491 topic_id: 4914 reply_id: 67266[/import]