2010/09/18

[Android Tips] 화면 해상도 알아내기


방법 #1


DisplayMetrics metrics = new DisplayMetrics();
getWindowManager().getDefaultDisplay().getMetrics(metrics);

int ScreenWidth = metrics.widthPixels
int ScreenHeight = metrics.heightPixels






방법 #2


WindowManager wm = (WindowManager)getSystemService(Context.WINDOW_SERVICE);
Display dsp = wm.getDefaultDisplay();

int height = dsp.getHeight();
int width = dsp.getWidth();
<

Original Post : http://neodreamer-dev.tistory.com/459

No comments :

Post a Comment