I have problems to be able to implement correctly how to hide the buttons that are located at the bottom/footer. Those 3 buttons of Back, Home, Applications. I am implementing this code and it works correctly, it hides the TOP navigation bar and the Footer one. But the problem is when I click on my EditText, which appears the Virtual Keyboard. Once finished what you want to write, the 3 buttons of Back, Home, Applications. They are back visible. What do I need to implement? What am I doing wrong?
@Override
public void onWindowFocusChanged(boolean hasFocus) {
super.onWindowFocusChanged(hasFocus);
if (hasFocus) {
hideSystemUI();
}
}
private void hideSystemUI() {
View decorView = getWindow().getDecorView();
decorView.setSystemUiVisibility(
View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY
| 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
| View.SYSTEM_UI_FLAG_FULLSCREEN);
}
Just return the view into listener in onCreate
. Once I implemented this code: I am giving this sample to you:
@Override
protected void onCreate(Bundle savedInstanceState){
super.onCreate(savedInstanceState);
View decorView = hideSystemUI();
decorView.setOnSystemUiVisibilityChangeListener(new
View.OnSystemUiVisibilityChangeListener() {
@Override
public void onSystemUiVisibilityChange(int visibility) {
hideSystemUI();
}
});
}
private View hideSystemUI() {
View decorView = getWindow().getDecorView();
decorView.setSystemUiVisibility(
View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY
| 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
| View.SYSTEM_UI_FLAG_FULLSCREEN);
return decorview;
}
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.