Android get screen width and height

 WindowManager winManage = getWindowManager() ;
        Display winDisplay = winManage.getDefaultDisplay() ;
        int winHeight = winDisplay.getHeight() ;
        int winWeight = winDisplay.getWidth() ;

        Log.e("高度 高度 高度 高度 高度 ",winHeight+"");
        Log.e("宽度 宽度 宽度 宽度 宽度 ",winWeight+"");

 

Guess you like

Origin blog.csdn.net/qq_41630695/article/details/109243990