         systemManager.stage.addEventListener(KeyboardEvent.KEY_UP, deviceKeyUpHandler);
         systemManager.stage.addEventListener(StageOrientationEvent.ORIENTATION_CHANGE, 
                                              orientationChangeHandler);
-        
-        // Add application deactivate and activate listeners
         NativeApplication.nativeApplication.
-            addEventListener(Event.ACTIVATE, applicationActivateHandler);
+            addEventListener(InvokeEvent.INVOKE, nativeApplication_invokeHandler);
         
         // We need to listen to different events on desktop and mobile because
         // on desktop, the deactivate event is dispatched whenever the window loses

        
        if (os.indexOf("Windows") != -1 || os.indexOf("Mac OS") != -1)
            NativeApplication.nativeApplication.
                addEventListener(Event.EXITING, applicationDeactivateHandler);
        else
            NativeApplication.nativeApplication.
                addEventListener(Event.DEACTIVATE, applicationDeactivateHandler);
    }
    
    /**
     * 
     *  @langversion 3.0
     *  @playerversion Flash 10
     *  @playerversion AIR 2.5
     *  @productversion Flex 4.5
     */  
    protected function applicationActivateHandler(event:Event):void
    {
    }
    
    /**
     * 
     *  @langversion 3.0
     *  @playerversion Flash 10
     *  @playerversion AIR 2.5
     *  @productversion Flex 4.5
     */ 
    protected function applicationDeactivateHandler(event:Event):void
    {
        if (sessionCachingEnabled)
        {

import flash.desktop.NativeApplication;
import flash.display.StageOrientation;
import flash.events.Event;
import flash.events.InvokeEvent;
import flash.events.KeyboardEvent;
import flash.events.StageOrientationEvent;
import flash.system.Capabilities;
