본문 바로가기
프로그래밍 놀이터/안드로이드, Java

[android] 단말 screen width, height 얻어오는 방법.

by 돼지왕 왕돼지 2012. 10. 26.
반응형



단말 screen width, height 얻어오는 방법.

Activity 이용.

Display display = getWindowManager().getDefaultDisplay();

int width = display.getWidth();

int height = display.getHeight();




Context 이용.

WindowManager wm;
wm =  
WindowManager) context.getSystemService(Context.WINDOW_SERVICE);

Display display = wm.getDefaultDisplay();




도움이 되셨다면 손가락 꾸욱~ ( 로그인 필요 x )



반응형

댓글