Skip to main content
Known Participant
June 1, 2014
Question

Android and iOS closing app?

  • June 1, 2014
  • 2 replies
  • 469 views

I am developing an app for Android and iOS and when I press the home button on my Android phone the game's thread is still running in the background.

The music keeps on going.

How can I detect when the user exits the app in order to stop the music or terminate the app's thread?
How can I terminate the app's thread?

This topic has been closed for replies.

2 replies

Inspiring
June 3, 2014

On iOS you add a UIApplicationExitsOnSuspend key to your app xml file like so:

<InfoAdditions>

      <![CDATA[<key>UIDeviceFamily</key><array><string>2</string></array><key>UIApplicationExitsOnSuspend</key><true/>]]>

    </InfoAdditions>

on Android it's a different story. See this:

android - Quitting an application - is that frowned upon? - Stack Overflow

kglad
Community Expert
Community Expert
June 2, 2014

the event class has an activate and a deactivate events you can use.