//获取屏幕宽高
DisplayMetrics displayMetrics = getResources().getDisplayMetrics();
float density = displayMetrics.density;
int widthPixels = displayMetrics.widthPixels; //宽
int heightPixels = displayMetrics.heightPixels; //高
Log.e(TAG, "onCreate: " + widthPixels + ".........." + heightPixels );
网友评论