引用:http://android.tgbus.com/Android/tutorial/201105/352125.shtml
DisplayMetrics dm = new DisplayMetrics(); getWindowManager().getDefaultDisplay().getMetrics(dm); Cache.screenWidth = dm.widthPixels;//屏幕的宽