diff --git a/tns-core-modules/platform/platform.android.ts b/tns-core-modules/platform/platform.android.ts index f60de5800..0d26ef187 100644 --- a/tns-core-modules/platform/platform.android.ts +++ b/tns-core-modules/platform/platform.android.ts @@ -105,7 +105,8 @@ class MainScreen implements definition.ScreenMetrics { private _metrics: android.util.DisplayMetrics; private get metrics(): android.util.DisplayMetrics { if (!this._metrics) { - this._metrics = utils.ad.getApplicationContext().getResources().getDisplayMetrics(); + this._metrics = new android.util.DisplayMetrics(); + utils.ad.getApplicationContext().getSystemService(android.content.Context.WINDOW_SERVICE).getDefaultDisplay().getRealMetrics(this._metrics); } return this._metrics; }