I would like to know how can I apply full screen theme ( no title bar + no actionbar ) to an activity. I am using AppCompat library from support package v7.
I've tried to applied android:theme="@android:style/Theme.NoTitleBar.Fullscreen"
to my specific activity but it crashed. I think it's because my application theme is like this.
<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
I also have tried this
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
WindowManager.LayoutParams.FLAG_FULLSCREEN);
which only hides title bar but not the action bar. My current workaround is that hiding the actionbar with
getSupportActionBar().hide();
To hide both status bar and action bar and make your activity full-screen use the following code in your activity's
onResume()
oronWindowFocusChanged()
method:You can find more Information in the following links:
Note: Using the xml solutions provide in this thread I could only hide the status bar but not the navigation bar.
Based on the answer by @nebyan, I found that the action bar is still not hiding.
The following code works for me:
and of course dont forgot to edit your
AndroidManifest
file.