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) {
|
if (nativeView instanceof android.view.View) {
|
||||||
windowToken = nativeView.getWindowToken()
|
windowToken = nativeView.getWindowToken()
|
||||||
} else if (androidApp.foregroundActivity instanceof android.app.Activity) {
|
} else if (androidApp.foregroundActivity instanceof android.app.Activity) {
|
||||||
const currentFocus = androidApp.foregroundActivity.getCurrentFocus();
|
const decorView = androidApp.foregroundActivity.getWindow().getDecorView();
|
||||||
windowToken = currentFocus ? currentFocus.getWindowToken() : null;
|
windowToken = decorView ? decorView.getWindowToken() : null;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (inputManager && windowToken) {
|
if (inputManager && windowToken) {
|
||||||
|
|||||||
Reference in New Issue
Block a user