I want to get the displayable height of an activity. But, the display height I get from following snippet also include status bar height.
int screenHeight = context.getResources().getDisplayMetrics().heightPixels; What I want is the height starting from bottom edge of status bar or top edge of the screen to the top edge of bottom navigation bar (like, Nexus 4) or bottom edge of the screen (like, Samsung Galaxy S4). So what I do is I get the height pixels from above snippet and then deduct the status bar height
int screenHeight = ![context.getResources().getDisplayMetrics().heightPixels][1]; int statusBarHeight = 0; int resourceId = context.getResources().getIdentifier("status_bar_height", "dimen", "android"); if (resourceId > 0) { statusBarHeight = context.getResources().getDimensionPixelSize(resourceId); } int displayableHeight = screenHeight - statusBarHeight; This snippet only works correctly on phone and 7" tablet. But on 10" tablet (which I don't see status bar anywhere on screen), the statusBarHeight snippet return 50px. Which cause the displayableHeight 50px less than what user see on the screen.
Do you know why on 10" Tablet report status bar height = 50px since is not showing on screen and How can I fix this issue?
Best
