DisplayMetrics dm = new DisplayMetrics();
WindowManager windowMgr = (WindowManager)getApplicationContext().getSystemService(Context.WINDOW_SERVICE);
windowMgr.getDefaultDisplay().getMetrics(dm);
int width = dm.widthPixels;
int height = dm.heightPixels;
Toast.makeText(getApplicationContext(), "手机屏幕分辨率:"+width+"*"+height, Toast.LENGTH_LONG).show();
android获取屏幕分辨率实现
最新推荐文章于 2021-05-27 12:59:11 发布