Any idea on how to get the screen height on Androi...
# android
e
Any idea on how to get the screen height on Android... Trying to use
Display.getMetrics
but the API is not consistent... On some devices the method includes the status bar height while on others it gives only the usable area of the screen...
a
do you want to include the nav bar? use getRealSize from 19 onwards if you want to add it
e
no I just want the part of the screen without the nav and status bars
o
Why do you need to know the “usable” screen height? What is your task?
e
want to open a full screen dialog...
o
Try to set MATCH_PARENT height to your layout and add flag to your dialog’s window:
Copy code
LayoutParams.FLAG_FULLSCREEN
e
okay thanks