//取屏幕分辩率
DisplayMetrics displayMetrics = new DisplayMetrics();
getWindowManager().getDefaultDisplay().getMetrics(displayMetrics);
txtView.setText("屏幕分辨率为:" + displayMetrics.widthPixels + ":" + displayMetrics.heightPixels);
DisplayMetrics displayMetrics = new DisplayMetrics();
getWindowManager().getDefaultDisplay().getMetrics(displayMetrics);
txtView.setText("屏幕分辨率为:" + displayMetrics.widthPixels + ":" + displayMetrics.heightPixels);