​

DisplayMetrics dm = new DisplayMetrics();

getWindowManager().getDefaultDisplay().getMetrics(dm);


Cache.screenWidth = dm.widthPixels;//屏幕的宽