White screen is displayed while switching between Activities

androidXXX picture androidXXX · Oct 16, 2015 · Viewed 12.4k times · Source

When I move from one Activity to another Activity, a white screen is displayed for 2 seconds. I am using this code:

Intent intent = new Intent(this, SecondActivity.class);
startActivity(intent);

How can I resolve this issue?

Answer

Ziwei Zeng picture Ziwei Zeng · Jun 14, 2017

Create a Theme like this:

<style name="YourTheme" parent="YourParentTheme">
    <item name="android:windowDisablePreview">true</item>
</style>

Apply this theme to your second activity

More detail in this link: http://www.tothenew.com/blog/disabling-the-preview-or-start-window-in-android/