Some other solutions out there are outdated.
This solution is when you are targeting API 13+. (You should now be targeting 14+ - written in 2015.08.11)
int smallestDp = getResources().getConfiguration().smallestScreenWidthDp;
if(smallestDp >= 600 && smallestDp < 720) { // 7" ~ <10"
}
else if(smallestDp >= 720) { // 10"+
}
No comments:
Post a Comment