0

In my Android application I seen black screen before splash screen so that I

have customized app theme as follows:

    <!-- Application theme. -->
    <style name="AppTheme" parent="AppBaseTheme">

        <!-- my custom theme. -->
        <item name="android:windowNoTitle">true</item>
        <item name="android:windowContentOverlay">@null</item>
        <item name="android:windowBackground">@drawable/splash1</item>
    </style>

the following is work for API version 20 and below version but in kitkat version (API version 21) it open the my splash screen two times. I could not get solution after working long time. Please help me on this.

M.A.Murali
  • 9,988
  • 36
  • 105
  • 182

2 Answers2

2

I am getting blank screen and i found the issue that "A TaskDescription's primary color should be opaque", means you have to replace your colorPrimary and colorPrimaryDark to 6 digits,

example: if you take colorPrimary = #4D607D8B remove "4D" and finally it is #607D8B. you can refer this link: https://stackoverflow.com/a/29166908/2897365

varotariya vajsi
  • 3,965
  • 37
  • 39
0

Try this,

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

theme.xml

<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" >
Parth Bhayani
  • 1,894
  • 3
  • 17
  • 35