Closing the Application

Must Read

Just post!

If another application is selected, yours is moved to the background but continues to play and does not close. Typically, NativeApplication dispatches an exiting event when it starts the closing process. You can register for that event and be prepared to act quickly according to your application needs:

import flash.desktop.NativeApplication;
NativeApplication.nativeApplication.addEventListener(Event.EXITING, onExit);
function onExit(event:Event):void {
// save application’s current state

However, the Android OS may choose to terminate background processes immediately if RAM is needed. In some cases, such as receiving a phone call, there is no guarantee that NativeApplication will have a chance to dispatch the exiting event before being shut down. It is therefore a good practice to save critical data often while the application is active.

The Android OS closes applications that were inactive the longest first. If you want to immediately shut down a particular application, select Settings→Applications→Manage applications→Running, click the desired icon, and press “Force stop.” You can also use third-party task killer applications, which conveniently display all the applications currently
running in one selection.

The Android UX guidelines recommend using the back or home button as an exit button. But you may choose to shut down your AIR application via code when it moves to the background, or make it a user option while it is running to run the following method:



- Advertisement -

Latest News

STOOF International presents armoured SUV Trojan with certified maximum protection

The "Trojan", based on the Toyota LC 300, in resistance class VR9, from STOOF International, represents an absolute novelty...
- Advertisement -

More Articles Like This

- Advertisement -