diff --git a/tns-core-modules/utils/utils.android.ts b/tns-core-modules/utils/utils.android.ts index 5a3f0b229..7ad6515ed 100644 --- a/tns-core-modules/utils/utils.android.ts +++ b/tns-core-modules/utils/utils.android.ts @@ -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) {