How to hide the actionbar before the Activity is loaded?
try this in manifest file
<activity
android:name="yourActivityName"
android:label="your label"
android:theme="@android:style/Theme.Holo.Light.NoActionBar.Fullscreen" >
</activity>
Check this link Android: hide action bar while view load
Code snippets from the link, incase the link breaks down, courtesy @kleopatra:
Setting the properties
windowNoTitle
to true on your theme will hide the ActionBar. use two different themes both extendingparent="Theme.AppCompat.Light"
in order to prevent NPE when using getSupportActionBar
set the styles as
<style name="AppThemeNoBar" parent="Theme.AppCompat.Light"> <item name="android:windowNoTitle">true</item> </style> <style name="AppThemeBar" parent="Theme.AppCompat.Light"> <item name="android:windowNoTitle">false</item> </style>
Due to some odd behaviour on versions < 11, you need to add
if (Build.VERSION.SDK_INT < 11){ getSupportActionBar().hide(); }
inside activities that do not need the actionbar