Skip to main content
Participating Frequently
February 9, 2012
Question

Getting the application to exit when the user presses the Home button

  • February 9, 2012
  • 1 reply
  • 446 views

I've got this, currently, but it doesn't seem to work:

               NativeApplication.nativeApplication.addEventListener(Event.DEACTIVATE, onDeactivateApp);
...
          protected function onDeactivateApp(event:Event):void
          {
               NativeApplication.nativeApplication.exit();
          }

Help?

This topic has been closed for replies.

1 reply

Known Participant
February 3, 2013

For IOS the following addition to the application descriptor file should work

<iPhone>

                     <InfoAdditions>

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

    </InfoAdditions>

 

  </iPhone>

The code you pasted works on my Nexus 7 Android app