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();
You can follow below step:-
AndoridMenifest.xml
Style.xml
FullImageActivity.java
I hope it will help..Thanks!!
Using the above xml in style.xml, you will be able to hide the title as well as action bar.
Your "workaround" (hiding the actionBar yourself) is the normal way. But google recommands to always hide the ActionBar when the TitleBar is hidden. Have a look here: https://developer.android.com/training/system-ui/status.html
It should be parent="@style/Theme.AppCompat.Light.NoActionBar"
Issues arise among before and after versions of Android 4.0 (API level 14)..
from here https://developer.android.com/training/system-ui/status.html I created my own solution..
I write this code in onResume() method because if you exit from your app and then you reopen it, the action bar remains active! (and so this fix the problem)
I hope it was helpful ;)