how to fix white screen on app start up android

My android app displays white screen on start up as shown below in gif image 1. Here, by default property android:windowDisablePreview is false.

 gif image 1. - 
white screen on app start up android  for 1sec
after adding custom style to Splashactivity

TO Disable the Preview Window in Android need to add style to your Splashactivity.

Add style element to your styles.xml
<style name="AppThemeHome" parent="Theme.AppCompat.Light">
        <item name="windowNoTitle">true</item>
        <item name="android:windowDisablePreview">true</item>
</style>

then, add it as your custom style to AndroidManifest.xml as shown below
<activity android:name=".SplashActivity"
            android:theme="@style/AppThemeHome">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
</activity>
                                    

No comments:

Post a Comment

Popular Posts