• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
Locked
0

Android keydown listeners not working after StageWebView display

Guru ,
Dec 24, 2016 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

TOPICS
Air beta

Views

583

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
community guidelines

correct answers 1 Correct answer

Guru , Dec 28, 2016 Dec 28, 2016

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

Votes

Translate

Translate
Guru ,
Dec 28, 2016 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).

Votes

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
community guidelines
Explorer ,
Jan 05, 2017 Jan 05, 2017

Copy link to clipboard

Copied

LATEST

Thanks Greg!

Votes

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
community guidelines