Created
November 18, 2013 05:36
-
-
Save sakurabird/7523039 to your computer and use it in GitHub Desktop.
screen size 表示
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
int screenSize = getResources().getConfiguration().screenLayout & | |
Configuration.SCREENLAYOUT_SIZE_MASK; | |
switch (screenSize) { | |
case Configuration.SCREENLAYOUT_SIZE_LARGE: | |
Utils.showToast("Large screen"); | |
break; | |
case Configuration.SCREENLAYOUT_SIZE_NORMAL: | |
Utils.showToast("Normal screen"); | |
break; | |
case Configuration.SCREENLAYOUT_SIZE_SMALL: | |
Utils.showToast("Small screen"); | |
break; | |
case Configuration.SCREENLAYOUT_SIZE_XLARGE: | |
Utils.showToast("xlarge screen"); | |
break; | |
default: | |
Utils.showToast("Screen size is neither large, xlarge, normal or small"); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment