I was trying to get the screen resolution of android phones,using this code
DisplayMetrics dm = new DisplayMetrics();
getWindowManager().getDefaultDisplay().getMetrics(dm);
str_ScreenSize = dm.widthPixels + " x " + dm.heightPixels;
str_ScreenSize = "dd" + " x " + dm.heightPixels;
When i tried this code in my Galaxy S phone i got the screen resolution as 320x533 px, but in reality the Galaxy S got a screen resolution of 480x800 px. So what's wrong with the code??
How can i get the actual screen resolution of a particular device??
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…