2011. 4. 25. 11:04
1.화면이 가로, 세로 변경시 이벤트
@Override
public void onConfigurationChanged(Configuration newConfig) {
super.onConfigurationChanged(newConfig);
int cnt=0;
switch(newConfig.orientation){
case Configuration.ORIENTATION_LANDSCAPE:
//TODO
break;
case Configuration.ORIENTATION_PORTRAIT:
//TODO
break;
}
}
2.현제 화면이 가로, 세로인지 확인
Configuration config = getResources().getConfiguration();
if(config.orientation == Configuration.ORIENTATION_PORTRAIT){
//TODO
}
else if(config.orientation == Configuration.ORIENTATION_LANDSCAPE){
//TODO
}
'Programming > Android' 카테고리의 다른 글
Android - Bitmap, Drawable convert (0) | 2011.05.13 |
---|---|
Android - 디바이스의 가로, 세로 가져오기 (0) | 2011.05.04 |
Android - 타이틀바, 위쪽 상태표시창 제거하기 및 풀스크린 (0) | 2011.04.18 |
Android - WebView auto fit (0) | 2011.04.14 |
Android - WebView Scroll Disable (0) | 2011.04.14 |