I know how to hide the status bar on Android tablets. I am doing this with this code:
getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_LOW_PROFILE);
It works fine, but only once. When I touch the status bar, it is activated, and when after that I return to my activity, the status bar is still activated (with icons instead of dots). I tried to enter onResume, but it was not called, so I searched googled again and found another solution - using a handler to change the visibility of the status bar:
getWindow().getDecorView().setOnSystemUiVisibilityChangeListener(new View.OnSystemUiVisibilityChangeListener() { @Override public void onSystemUiVisibilityChange(int visibility) { getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_LOW_PROFILE); } });
Sometimes it works, but after several attempts it breaks.
I need this for the game - theoretically I can try to call it after every touch or every time in the main loop, but this seems like a bad idea (and, in addition, it should be called from a specific thread - only the original thread that created the presentation hierarchy can touch his representations.).
My question is: what is the best way to implement automatic anti-aliasing of the status bar? Or, in my situation, anyway.
source share