Search code examples
androidsplash-screenapp-startup

How To fix white screen on app Start up?


I have an android app which displays a white screen for 2 seconds on startup. My other apps don't do this, but this one does. I have also implemented a splashscreen with the hope that it would fix this. Should I increase my splash screen sleep time? Thanks.


Solution

  • Just mention the transparent theme to the starting activity in the AndroidManifest.xml file.

    Like:

    <activity
            android:name="first Activity Name"
            android:theme="@android:style/Theme.Translucent.NoTitleBar" >
     <intent-filter>
                <action android:name="android.intent.action.MAIN" />
    
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
     </activity>
    

    and extend that screen with Activity class in place of AppCompatActivity.

    like :

    public class SplashScreenActivity extends Activity{
    
      ----YOUR CODE GOES HERE----
    }