Cancel status bar
GetWindow (). SetFlags (WindowManager.LayoutParams.FLAG_FULLSCREEN,
WindowManager.LayoutParams.FLAG_FULLSCREEN);
Must be above the Setcontentview ()
Hide virtual keys:
protected void Hidebottomuimenu () {
//Hide virtual keys, and full screen
if (Build.VERSION.SDK_INT > && build.ve Rsion. Sdk_int <) {//Lower API
View v = This.getwindow (). Getdecorview ();
V.setsystemuivisibility (View.gone);
} else if (Build.VERSION.SDK_INT >=) {
//for new API versions.
View Decorview = GetWindow (). Getdecorview ();
int uioptions = View.system_ui_flag_hide_navigation
| View.system_ui_flag_immersive_sticky | View.system_ui_flag_fullscreen;
Decorview.setsystemuivisibility (uioptions);
}
}
This can also be:
public void Hidenavigationbar () {
int uiflags = view.system_ui_flag_layout_stable
| View.system_ui_flag_layout_hide_navigation
| View.system_ui_flag_layout_fullscreen
| View.system_ui_flag_hide_navigation//HIDE nav Bar
| View.system_ui_flag_fullscreen; Hide Status bar
if (Android.os.Build.VERSION.SDK_INT >= 19) {
Uiflags |= view.system_ui_flag_immersive;//0x00001000; System_ui_flag_immersive_sticky:hide
} else {
Uiflags |= View.system_ui_flag_low_profile;
}
try {
GetWindow (). Getdecorview (). setsystemuivisibility (Uiflags);
} catch (Exception e) {
Todo:handle exception
}
}
Android removal status bar and hidden virtual keys