When the Android device is tilted and switches from portrait to landscape mode, the values โโreturned in the DisplayMetrics object (i.e. from getDisplayMetrics ()) reflect that pixels are now larger in this width and smaller in heightPixels?
source share