Is AS3 an event for which application Android came out on its own?

OK, I made an app for Android. And when we press the central button or back (lefthandside) of phone Android, we know all that Android apps always runs in the background.
So my code is as follows:

the first line (addEventListener) is a private function that works as soon as you open the application.

NativeApplication.nativeApplication.addEventListener (flash.events.Event.EXITING, onMyAppExit)

private void onMyAppExit (event:flash.events.Event): void {}
trace ("onMyAppExit is running");
saveProgress();
}


Basically, I want saveProgress() to run when the application leaves ACTUALLY being run in the background. I noticed that my application leave actually when I open another application like Candy Crush. I assumed that the Android operating system leaves apps automatically when applications are not used and when the application you use takes a lot of RAM. However, my code does that when I run my application in AIR Debug Launcher (Mobile). I know that, because I see the sign of the function in my window out when I click the x button in the right corner of the application window. But when I connect my Android phone to the computer and then-> AIR3.8 for Android settings-> publish and then I "Start to debug remote Session" and on my Android phone, I open my application first, then Candy Crush so that the Android OS automatically leaves my app, I don't see the trace. So I put that code does not work on my phone.

Sorry, something like that scene is absurd in this context.  use:

NativeApplication.nativeApplication (Event.Deactivate, onMyAppExit);

There is also an event of Event.SUSPEND you can use.

Tags: Adobe Animate

Similar Questions

Maybe you are looking for