How to load instant Splash screen like in Google Android Apps?

廉价感情. 提交于 2019-12-06 11:29:26

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

user1530779

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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!