Copy link to clipboard
Copied
I have an app that has been responding to android back key presses reliably. It works correctly by closing flex popups if they are open etc until there are no more and then returns the app to its entry screen state, and then uses nativeApplication.exit() if there is no more 'back' navigation possible. I have recently been working on adding an Oauth2 login using StageWebView support.
However this back key functionality never works a soon as a StageWebView has been displayed (which also means I cannot programmatically use back key to manage history navigation in the webview), in fact the following listener no longer fires at all from the point when a StageWebView first displays and persists after it is dismissed.
NativeApplication.nativeApplication.addEventListener(KeyboardEvent.KEY_DOWN, onCheckNavBackKey,false,int.MAX_VALUE);
This is with Air 24, but I tried with some recent older Air SDKs with the same results.
This could also be related to problems I see with the softkeyboard not working after StageWebView: Issues with softkeyboard not showing on textinput focus after a StageWebView has displayed for the f...
Basically I need a way to close (remove the display of) the StageWebView via the android back key press and have the original back key handling listener continue to work. If anyone has encountered this and has found a solution or workaround, I would be very grateful if you could please share it
I assume this did work at some point in history because there are code examples scattered around for supporting the history functions in StageWebView via android back key.
Thanks
-Greg
The issue was resolved.
_stage.displayState = StageDisplayState.FULL_SCREEN;
needed to be changed to:
_stage.displayState = StageDisplayState.FULL_SCREEN_INTERACTIVE;
After disposing the StageWebView
The fact that mouse events etc still occur in the 'non-interactive' mode was deceiving me.... the INTERACTIVE is required for soft keyboard (and it turns out, also to receive the back key on android).
Copy link to clipboard
Copied
The issue was resolved.
_stage.displayState = StageDisplayState.FULL_SCREEN;
needed to be changed to:
_stage.displayState = StageDisplayState.FULL_SCREEN_INTERACTIVE;
After disposing the StageWebView
The fact that mouse events etc still occur in the 'non-interactive' mode was deceiving me.... the INTERACTIVE is required for soft keyboard (and it turns out, also to receive the back key on android).
Copy link to clipboard
Copied
Thanks Greg!