mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-11-05 13:26:48 +08:00
Use getDecorView() to lose focus
This commit is contained in:
@@ -105,8 +105,8 @@ export module ad {
|
||||
if (nativeView instanceof android.view.View) {
|
||||
windowToken = nativeView.getWindowToken()
|
||||
} else if (androidApp.foregroundActivity instanceof android.app.Activity) {
|
||||
const currentFocus = androidApp.foregroundActivity.getCurrentFocus();
|
||||
windowToken = currentFocus ? currentFocus.getWindowToken() : null;
|
||||
const decorView = androidApp.foregroundActivity.getWindow().getDecorView();
|
||||
windowToken = decorView ? decorView.getWindowToken() : null;
|
||||
}
|
||||
|
||||
if (inputManager && windowToken) {
|
||||
|
||||
Reference in New Issue
Block a user