Android programming activity startup white screen black screen problem solution

  • 2020-11-25 07:33:48
  • OfStack

This paper describes the Android programming activity startup white screen, black screen problem solution. To share for your reference, the details are as follows:

By default, when activity starts, the screen is painted white before the interface is drawn. There is more or less delay in drawing the interface. During this time, you will see a white screen, which obviously affects the user experience.

Set style on Activity theme


<style name="AppTheme" parent="android:Theme.Light.NoTitleBar"> 
 <item name="android:windowIsTranslucent">true</item> 
 <item name="android:windowNoTitle">true</item> 
 <item name="android:windowActionBar">false</item> 
 <item name="android:windowBackground">@android:color/transparent</item> 
 <!-- All customizations that are NOT specific to a particular API-level can go here. --> 
</style> 


<application 
 android:name="com.skymobi.moposns.MyApplication" 
 android:allowBackup="true" 
 android:icon="@drawable/ic_launcher" 
 android:label="@string/app_name" 
 android:theme="@style/AppTheme" > 
<activity 
 android:name="com.skymobi.moposns.MainActivity" 
 android:label="@string/app_name" 
 android:screenOrientation="portrait" > 
 <intent-filter> 
  <action android:name="android.intent.action.MAIN" /> 
  <category android:name="android.intent.category.LAUNCHER" /> 
 </intent-filter> 
</activity>

I hope this article has been helpful in Android programming.


Related articles: