android - Fullscreen/Immersive mode lost when application come back to foreground -


i'm trying add immersive mode on android application using opengl es. work, when put application background , come in, application lose full screen status (navigation bar back).

here method put application fullscreen/immersive mode (i call oncreate in mainactivity):

private void setfullscreen()  {        int uioptions = this.getwindow().getdecorview().getsystemuivisibility();     if (build.version.sdk_int >= 14) {         uioptions ^= view.system_ui_flag_hide_navigation;     }     if (build.version.sdk_int >= 16) {         uioptions ^= view.system_ui_flag_fullscreen;     }     if (build.version.sdk_int >= 18) {         uioptions ^= view.system_ui_flag_immersive_sticky;     }      this.getwindow().getdecorview().setsystemuivisibility(uioptions); } 

how can handle that? thanks!

call setfullscreen() in onresume() method instead of oncreate().


Comments

Popular posts from this blog

Android layout hidden on keyboard show -

google app engine - 403 Forbidden POST - Flask WTForms -

c - Why would PK11_GenerateRandom() return an error -8023? -