Created
June 22, 2018 02:16
-
-
Save valentincognito/41a9910c5da42108171303c3b86dea13 to your computer and use it in GitHub Desktop.
Get the screen dimension at runtime
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DisplayMetrics displayMetrics = new DisplayMetrics(); | |
getWindowManager().getDefaultDisplay().getMetrics(displayMetrics); | |
int height = displayMetrics.heightPixels; | |
int width = displayMetrics.widthPixels; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment