Created
January 22, 2015 15:42
-
-
Save alxsimo/cb6e0484c57704b39fcb to your computer and use it in GitHub Desktop.
[Android] Device display density
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
| switch (getResources().getDisplayMetrics().densityDpi) { | |
| case DisplayMetrics.DENSITY_LOW: | |
| // ... | |
| break; | |
| case DisplayMetrics.DENSITY_MEDIUM: | |
| // ... | |
| break; | |
| case DisplayMetrics.DENSITY_HIGH: | |
| // ... | |
| break; | |
| case DisplayMetrics.DENSITY_XHIGH: | |
| // ... | |
| break; | |
| } | |
| // More info: http://developer.android.com/intl/es/reference/android/util/DisplayMetrics.html |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment