Android removal status bar and hidden virtual keys

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.