Android fullscreen app - prevent access to status bar

后端 未结 2 1653
没有蜡笔的小新
没有蜡笔的小新 2020-12-04 02:51

I am creating a fullscreen app which will run in \"kiosk\" mode, so the user will not be able to exit. The app is defined as a launcher (home screen).

The Acti

2条回答
  •  一生所求
    2020-12-04 03:39

    put this code in oncreate method

    int myflag= View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
                | View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION
                | View.SYSTEM_UI_FLAG_LAYOUT_STABLE
                | View.SYSTEM_UI_FLAG_LOW_PROFILE
                | View.SYSTEM_UI_FLAG_FULLSCREEN
                | View.SYSTEM_UI_FLAG_HIDE_NAVIGATION;
    
    getWindow().getDecorView().setSystemUiVisibility(myflag);
    

    for more details https://developer.android.com/training/system-ui/immersive.html

提交回复
热议问题