My goal is to show a splash screen on my applications startup. Right now what it will do is briefly show the actionbar with an otherwise blank page, then jump to the splash screen. I'm trying to figure out how to not show the beginning screen and just start with the splash screen. I'm trying to use these links for information on how to solve this.
ActionBar Lag in hiding title In this one I'm assuming I can use the same type of method for hiding the actionbar by changing the theme, but I don't know what I would actually use as my style to do so.
How to hide action bar before activity is created, and then show it again? and here it talks about adding a line to the manifest that would do it. Where in the manifest? Anywhere I put it did not do anything.
If you want to hide Action Bar from the entire application (from all Activities and fragments), then you can use this method. Just go to res -> values -> styles. xml and change the base application to “Theme.
If we want to remove the ActionBar only from specific activities, we can create a child theme with the AppTheme as it's parent, set windowActionBar to false and windowNoTitle to true and then apply this theme on an activity level by using the android:theme attribute in the AndroidManifest. xml file.
You can directly hide Action Bar for a specific activity by specifying the NoActionBar theme in its activity tag in the manifest file. For this simply navigate to your projects' root and open the Android manifest file and add a single line of code as mentioned below.
The requestWindowFeature(Window. FEATURE_NO_TITLE) method of Activity must be called to hide the title.
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
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