I want to get pixels in nubia z7 mini,whose system is android 4.4.2,but i failed. my code is below:
DisplayMetrics dm = new DisplayMetrics();
getWindowManager().getDefaultDisplay().getMetrics(dm);
String strOpt = "PIXEL:" +
dm.widthPixels + " × " + dm.heightPixels;
I get is 320 * 569 ,but the pixel of my phone can't be that; then i print density,i found it is 1.0,i can't know why;
context.getResources().getDisplayMetrics().density
where was my error???How to get the pixels in a cellphone???