- private void getScreenSizeOfDevice2() {
- Point point = new Point();
- getWindowManager().getDefaultDisplay().getRealSize(point);
- DisplayMetrics dm = getResources().getDisplayMetrics();
- double x = Math.pow(point.x/ dm.xdpi, 2);
- double y = Math.pow(point.y / dm.ydpi, 2);
- double screenInches = Math.sqrt(x + y);
- Log.d(TAG, "Screen inches : " + screenInches);
- }
android获取屏幕尺寸
最新推荐文章于 2019-10-15 11:30:49 发布