获取手机屏幕长宽

DisplayMetrics mDisplayMetrics = new DisplayMetrics();
getWindowManager().getDefaultDisplay().getMetrics(mDisplayMetrics);
int W = mDisplayMetrics.widthPixels;
int H = mDisplayMetrics.heightPixels;
Log.i("Main", "Width = " + W);
Log.i("Main", "Height = " + H);

  

posted @ 2016-06-07 20:30  凤雏小呆  阅读(211)  评论(0编辑  收藏  举报