2

I have a splash screen activity which is just a image inside a relative layout.

When my app loads, before the splash screen is shown there is a solid color (same of windowBackgroud).

How can I make it so that it will load my splash right away like for example Googles Youtube app.

MikeC
  • 255
  • 4
  • 15
  • 1
    image loading requires network Call? Please post clear questions else it becomes difficult answering them – user1530779 Jul 06 '15 at 16:09
  • No, image is stored in resource folder. – MikeC Jul 06 '15 at 16:11
  • So what is the problem is your splash screen set as launcher in your manifest , Can you post a pic as to what is happening – user1530779 Jul 06 '15 at 16:13
  • Yes my splash screen is set as launcher. I can't take a screenshot because it's to fast but for half a second it first shows just a white screen before loading the splash screen. – MikeC Jul 06 '15 at 16:18

2 Answers2

0

The system loads the activity with default background if no background is specified in the theme of the activity.To avoid blank screen add a custom theme with the background color or image which you want. Set this theme to the splash activity.

For detailed example refer here

rupesh jain
  • 3,287
  • 1
  • 10
  • 21
-1

Black screen before Splash screen appear in android

Its a duplicate question please check questions before posting

Add a theme with the background you are using to your application tag in the manifest file to prevent the black screen to be drawn.

<resources>
<!-- Base application theme is the default theme. -->
<style name="Theme" parent="android:style/Theme" />

<style name="Theme.MyAppTheme" parent="Theme">
    <item name="android:windowNoTitle">true</item>
    <item name="android:windowContentOverlay">@null</item>
    <item name="android:windowBackground">@drawable/my_app_background</item>

</style>
</resources>

AndroidManifest.xml

....
<application
        android:name="@string/app_name"
        android:icon="@drawable/ic_launcher"
        android:label="@string/app_name"
        android:theme="@style/Theme.MyAppTheme"
         >
....

But you can only set an image or bgcolor here no custom Layout

Community
  • 1
  • 1
user1530779
  • 379
  • 3
  • 8