Android – how do I delete a white screen that appears before the splash screen?

When opening a java file, I first look at the blank white screen, and then look at my startup screen layout. I have a java file:

new Handler().postDelayed(new Runnable() {
                @Override
                public void run() {
                    //Task 
                    finish();
                }
              }, ARG_SPLASH_TIME);

In the XML file, I just need to put in the ImageView and set the Android: SRC value. In the manifest file, I open the splash activity in launcher mode

resolvent:

Finally got my answer splash screen in right way

In values - > styles.xml, I created the background image of the startup screen

<style name="AppTheme.Splash" parent="AppTheme.NoActionBar">
    <item name="android:windowBackground">@drawable/splash</item>
</style>

For the following API 19, in the value - 19 - > styles.xml I use

<style name="AppTheme.Splash" parent="AppTheme.NoActionBar">
    <item name="android:windowBackground">@drawable/splash</item>
    <item name="android:windowTranslucentStatus">true</item>
    <item name="android:windowTranslucentNavigation">true</item>
</style>

I deleted setcontentview () from splashactivity and added the style Android: theme = "@ style / apptheme. Splash" to the splash screen in the manifest.xml file

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>