1
2
3
4
5
6
7
8
9
10
|
boolean isTablet () {
int portrait_width_pixel=Math.min(this.getResources().getDisplayMetrics().widthPixels, this.getResources().getDisplayMetrics().heightPixels);
int dots_per_virtual_inch=this.getResources().getDisplayMetrics().densityDpi;
float virutal_width_inch=portrait_width_pixel/dots_per_virtual_inch;
if (virutal_width_inch <= 2) {
return false;
} else {
return true;
}
}
|
댓글 없음:
댓글 쓰기