获取屏幕的高宽度

 1 public class ScreenUtils {
 2     @SuppressWarnings("deprecation")
 3     public static int[] getScreenDispaly(Context context){
 4         WindowManager wm=(WindowManager)context.getSystemService(Context.WINDOW_SERVICE);
 5         int width=wm.getDefaultDisplay().getWidth();//手机屏幕的宽度
 6         int height=wm.getDefaultDisplay().getHeight();//手机屏幕的高度
 7         int result[] = {width,height};
 8         return result;
 9     }
10 }

 

posted on 2016-12-01 09:59  oooo呼呼  阅读(125)  评论(0编辑  收藏  举报