Adobe AIR back button event not working with Android API 28+

后端 未结 1 1301
误落风尘
误落风尘 2021-01-21 17:48

The key_down event is not being fired and we are not able to prevent the app to be closed. It\'s happening on Adobe AIR games when we target to Android API 28+ only (everything

1条回答
  •  别那么骄傲
    2021-01-21 17:57

    Finally I found the problem, it's related to the focus not being assigned to AIRWindowSurfaceView when I target the game to Android API 28.

    This is the code I have to run when the ANE is initialized in order to restore the focus:

      AndroidActivityWrapper aaw = AndroidActivityWrapper.GetAndroidActivityWrapper();
      aaw.getView().requestFocus();
      aaw.getView().onWindowFocusChanged(true);
    

    0 讨论(0)
提交回复
热议问题