When two activities jump, because the second Activity loads a large amount of data at startup, a short black screen time will appear before the second Activity starts, A simple solution to this problem is to set the theme of the second Activity to transparent, so that the black screen when the second Activity is started becomes the display of the first Activity interface. This is done in two steps:
Step 1: Add Theme of the custom Activity to xxx/res/values/styles. xml, as shown below:
[Html] <style name = "Transparent" parent = "android: Theme. Light">
<! -- Set Theme of the Activity to transparent -->
<Item name = "android: javaswistranslucent"> true </item>
</Style>
<Style name = "Transparent" parent = "android: Theme. Light">
<! -- Set Theme of the Activity to transparent -->
<Item name = "android: javaswistranslucent"> true </item>
</Style> Step 2: Set the "android: theme" attribute of the second Activity to the custom topic style in AndroidManifest. xml. As follows:
[Html] <activity
Android: name = "com. yutao. customer. mermeractivity"
Android: label = "@ string/app_name"
Android: theme = "@ style/Transparent">
<Activity
Android: name = "com. yutao. customer. mermeractivity"
Android: label = "@ string/app_name"
Android: theme = "@ style/Transparent"> at this point, the nasty black screen will not appear.