Splash screens should not be loaded from a layout file, there might still be some lag when loading it.
The best way is to create a Theme just for your SplashScreenActivity and set the android:windowBackground
to a drawable ressource.
https://www.bignerdranch.com/blog/splash-screens-the-right-way/
In a nutshell:
Declare your SplashScreenActivity in the manifest:
In your SplashScreenActivity.java:
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
Intent intent = new Intent(this, MainActivity_.class);
startActivity(intent);
finish();
}
Next create the ressource for the background window of your theme:
Drawable file splash.xml:
-