Skip to main content
Participating Frequently
Feb 9, 2012 6:57 PM UTC
Question

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

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 is closed to new replies. Start a new post to keep the conversation going.

1 reply

Known Participant
Feb 3, 2013 8:55 AM UTC

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

Translate