开发者

Back button unloads application after changes currentState of Android Application AIR

I am creating an application. At one view I have three states. If I changes state and than back button pressed it unloads the application.

I am developing it in Adobe AIR.

any one have any idea how to fix it.

Thanks开发者_开发技巧


States are not views, they do not get stacked in the navigator. Back button will never go backward for your states. The back button will drop the view you push until it reach the view 0, then it'll exit the application. You can monitor what's going on with the back button by listening like this:

systemManager.stage.addEventListener(KeyboardEvent.KEY_UP, handleCustomDeviceKeyUpHandler,false,10000);

private function handleCustomDeviceKeyUpHandler(event:KeyboardEvent):void {
    trace("handleCustomDeviceKeyUpHandler()")
    var key:uint = event.keyCode;
    if (key == Keyboard.BACK) {
        event.preventDefault(); //Comment if you don't want to prevent.
    }
}
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜