Highlighted

Android keydown listeners not working after StageWebView display

Guru ,
Dec 24, 2016

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).

TOPICS
Air beta

Views

447

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more

Android keydown listeners not working after StageWebView display

Guru ,
Dec 24, 2016

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).

TOPICS
Air beta

Views

448

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Dec 24, 2016 0
Guru ,
Dec 28, 2016

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).

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Dec 28, 2016 0
geretti LATEST
Explorer ,
Jan 05, 2017

Copy link to clipboard

Copied

Thanks Greg!

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Jan 05, 2017 0