0

I am trying to create a splash screen for my app. The problem is it first renders empty layout with default title bar and then fades in my image.

This is all I have onCreate

super.onCreate(savedInstanceState);
this.requestWindowFeature(Window.FEATURE_NO_TITLE);
this.setContentView(R.layout.activity_splash);

Attempted solution from switching activities without animation

Also tried to set window attributes

WindowManager.LayoutParams lp = this.getWindow().getAttributes();
lp.windowAnimations = lp.windowAnimations | android.R.attr.windowDisablePreview; 
this.getWindow().setAttributes(lp);

neither made any visible difference.

Community
  • 1
  • 1
Ilia G
  • 10,043
  • 2
  • 40
  • 59

1 Answers1

0

you can get rid of titlebar by setting theme for your splash activity. Add this to declaration of activity in your Manifest

android:theme="@android:style/Theme.NoTitleBar"
Marcin Orlowski
  • 72,056
  • 11
  • 123
  • 141
  • this makes things a little better, but doesn't fix the main issue. I need to disable the default animation so that it just shows my layout instead of fading it in. – Ilia G Jul 17 '12 at 18:12
  • To get rid of acitivity transition, use `Activity.overridePendingTransition()` to override system set transition with anything you want. – Marcin Orlowski Jul 17 '12 at 20:51
  • calling `overridePendingTransition(0, 0);` on `onCreate` seem to have no effect. I assume that means it doesn't work for the first activity in the task. – Ilia G Jul 17 '12 at 21:03
  • See docs: http://developer.android.com/reference/android/app/Activity.html#overridePendingTransition%28int,%20int%29 - it may be you are calling it i.e. too late? I'd try to google for some tutorials on that feature and once tutorial example works for you, tune it up to get what you need. – Marcin Orlowski Jul 18 '12 at 10:24