Hi,
As these threads mention …
https://forums.coronalabs.com/topic/53170-immersivesticky-and-displayscreenoriginx/
… apps can lose immersiveSticky mode under certain conditions.
A possible work-around is to not only re-set immersiveSticky mode, but to then use media.playVideo() to play a very short video clip.
This seems to (always?) force immersiveSticky back into effect.
The code is something like:
native.setProperty( "androidSystemUiVisibility", "immersiveSticky" ) media.playVideo( "shortVid.mp4", false )
The video clip is a one-second, all-black video I downloaded from youtube and trimmed to 0.10 seconds.
I’ve only tested it on my Android 5.0 device, but in all cases immersiveSticky is restored.
And visually, it’s not too jarring: the screen goes black for a split second, the navigation-bar flickers for another split-second and then slides off the screen.
NOTE: Playing a video causes “applicationSuspend”/“applicationResume” events, so if this is used in response to an “applicationResume” event, a check needs to be made that the video was not just played else the app will enter an loop.
HTH,
David