I need to implement splash screen in my honeycomb app. I use this code in activity's onCreate to show splash:
setContentView(R.layout.splash);
getActionBar().hide();
and this code to show main UI after sometime:
setContentView(R.layout.main);
getActionBar().show();
But before onCreate is called and splash appears, there is small amount of time when action bar shown.
How can I make action bar invisible?
I tried to apply theme to activity without action bar:
<item name="android:windowActionBar">false</item>
but in that case getActionBar() always returns null and I found no way to show it again.
best and simple
requestWindowFeature(Window.FEATURE_NO_TITLE); getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);
Try this, it works for me:
Below gets rid of activity's title bar
Below eliminates the notification bar to make the activity go full-screen
(Full Example Below) Take note: These methods were called before we set the content view of our activity
Best result to me was to create an activity with ThemeNoTitleBar and without content as launcher. Then this activity call directly to the other.
Of course if you want you can add content to the Splash Activity but in my case I just wanted to show application directly.
Manifest:
Activity:
}
Using this simple code in your .class file to hide action bar
@Clerics solution works. But this appears to also be an issue with some of googles native apps: googles, play store, talk. Also other big apps like skype.
EDIT: Bellow solution have given me problem for actionbarsherlock on api < 4.0, the reason being setTheme doesn't work pre ice cream sandwich
Add following in your manifest within you application or activity tags:
And then in your main activity:
For
Splashscreen
you should use this line inmanifest
and don't usegetActionBar()
and once when Splash
Activity
is finished in the mainActivity
use below or nothing