标签:ret 屏幕尺寸 splay window efault pixel tco idt activity
/**
* 获取屏幕物理尺寸
* @return
*/
private double getScreenSize(){
DisplayMetrics dm = new DisplayMetrics();
((Activity)getContext()).getWindowManager().getDefaultDisplay().getMetrics(dm);
double x = Math.pow(dm.widthPixels/dm.xdpi, 2);
double y = Math.pow(dm.heightPixels/dm.ydpi, 2);
double screenInches = Math.sqrt(x+y);
return screenInches;
}
标签:ret 屏幕尺寸 splay window efault pixel tco idt activity
原文地址:http://www.cnblogs.com/wutianlong/p/6900116.html