Search code examples
androidactionscript-3apache-flexair

Flex Air Android : Disable back button


In some modern devices, the back button on Android is pure software. The classical method to disable the back button don't work for me Disable back button

Is there any other solution (the manifest or else) to disable the back button on Android ?

Thanks guys.


Solution

  • Add this to your View or Application's properties and script:

    <s:View xmlns:fx="http://ns.adobe.com/mxml/2009"
        ....
        ....
        backKeyPressed="view1_backKeyPressedHandler(event)">
    
    
        // Add this to your <fx:Script> area:
        protected function view1_backKeyPressedHandler(event:FlexEvent):void
        {
            event.preventDefault();
            event.stopImmediatePropagation();
        }