I am using MediaController
with VideoView
. I am using the following solution to keep the app in immersive mode and it works.
activity.getWindow().getDecorView().setSystemUiVisibility(
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 |
View.SYSTEM_UI_FLAG_IMMERSIVE);
It doesn't work when the MediaController
shows up on the screen. I have tried putting up some listeners like when the media controller is shown, trigger the hide nav bar solution. But it does't work. Is there any workaround for this.