WindowManager wm = (WindowManager) context.getSystemService(Context.WINDOW_SERVICE);
DisplayMetrics outMetrics = new DisplayMetrics();
wm.getDefaultDisplay().getMetrics(outMetrics);
int mScreenWidth = outMetrics.widthPixels;//屏幕的宽度
int mScreenHeight = outMetrics.heightPixels;//屏幕的高度本文出自 “蜗牛旅途” 博客,请务必保留此出处http://8432499.blog.51cto.com/8422499/1738633
原文地址:http://8432499.blog.51cto.com/8422499/1738633