When I try to set sticky immersive mode via JNI using the Java method "setSystemUiVisibility
" the exception "Only the original thread that created a view hierarchy can touch its views." is thrown.
However, the function is called right when I get the APP_CMD_GAINED_FOCUS
/APP_CMD_RESUME
message, which according to the documentation is sent from the main thread.
My assumption is that the thread where the views are created (supposedly the UI-thread) and the NDK main thread the same thread, so why do I get this exception?
Note that this exception isn't always thrown, only when I resume program under special circumstances such as Google Play Games services ui's are launched.