DisplayMetrics displayMetrics = getResources().getDisplayMetrics();
float displayHeight = displayMetrics.heightPixels / displayMetrics.density;
float displayWidth = displayMetrics.widthPixels / displayMetrics.density;
Log.d("Display Height", displayHeight +"");
Log.d("Display Width", displayWidth +""); |
DisplayMetrics displayMetrics = getResources().getDisplayMetrics();
float displayHeight = displayMetrics.heightPixels / displayMetrics.density;
float displayWidth = displayMetrics.widthPixels / displayMetrics.density;
Log.d("Display Height", displayHeight +"");
Log.d("Display Width", displayWidth +"");