I know that I can acheive that with:
requestWindowFeature(Window.FEATURE_NO_TITLE);
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
WindowManager.LayoutParams.FLAG_FULLSCREEN);
I have a Settings Activity, where the user can set Fullscreen mode. When he comes back to the Main Activity, of course if he checked Fullscreen, the Activity must resume Fullscreen.
How to do this?
Thanks for help.
As u are using this which must be used before setContentView(int). i think give a try ur getWindow().setFlags() in onResume() alternatively i am giving a link which might help u for ur case.U can set condition before setting or removing those.
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);
You can use following link for your purpose which is doing the same for android 4.4 or below.Android 4.4 (API Level 19) introduces a new SYSTEM_UI_FLAG_IMMERSIVE flag for setSystemUiVisibility() that lets your app go truly "full screen. For lower ver as well link has some workaround by setting flags u can use.
https://developer.android.com/samples/ImmersiveMode/src/com.example.android.immersivemode/ImmersiveModeFragment.html
for remove flags u also have clearFlag() which u added for purpose when needed.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With