Portrait (create event is present)
GetDeviceLayout : 1080 * 1920
Activity.Width (100%x) = 1080
Activity.Height (100%y) = 1845
Landscape (no create/resume events)
GetDeviceLayout : 1920 * 1080
Activity.Width (100%x) = 1080
Activity.Height (100%y) = 1845
Probably, it's possible to use following
import android.graphics.Rect;
public int getActivityHeight ()
{
Rect rectangle = new Rect();
getWindow().getDecorView().getWindowVisibleDisplayFrame (rectangle);
return rectangle.bottom - rectangle.top;
}
And analog for width. Need to test ...