android full screen - Immersive mode (몰입 모드).
추가해줘야 하는 값은 총 3개입니다.
1. SYSTEM_UI_FLAG_HIDE_NAVIGATION
2. SYSTEM_UI_FLAG_FULLSCREEN
3. SYSTEM_UI_FLAG_IMMERSIVE_STICKY
public class MainActivity extends Activity {
private View decorView;
private int uiOption;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
decorView = getWindow().getDecorView();
uiOption = getWindow().getDecorView().getSystemUiVisibility();
if( Build.VERSION.SDK_INT >= Build.VERSION_CODES.ICE_CREAM_SANDWICH )
uiOption |= View.SYSTEM_UI_FLAG_HIDE_NAVIGATION;
if( Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN )
uiOption |= View.SYSTEM_UI_FLAG_FULLSCREEN;
if( Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT )
uiOption |= View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY;
//getWindow().getDecorView().setSystemUiVisibility(uiOption);
}
@Override
public void onWindowFocusChanged(boolean hasFocus) {
// super.onWindowFocusChanged(hasFocus);
if( hasFocus ) {
decorView.setSystemUiVisibility( uiOption );
}
}
}
<Androidmanifest.xml>
<uses-sdk android:minsdkversion="13" android:targetsdkversion="19"></uses-sdk>
'프로그래밍 > 안드로이드' 카테고리의 다른 글
Android Studio 프로젝트 jar 추가 (0) | 2015.06.26 |
---|---|
GCM Google 계정 변경 이후 "MismatchSenderId" (2) | 2015.06.26 |