In Android Studio choose New Project → Empty Views Activity, with Language Java and Minimum SDK API 24.
2. Add a splash activity
Right-click your package and choose New → Activity → Empty Views Activity. Name it SplashActivity.
3. Design the splash screen
In activity_splash.xml, centre your logo (an ImageView), the app name and a short tagline. Put your logo in res/drawable; a vector drawable stays sharp on every screen.
4. Make the background appear instantly
Create a splash theme whose android:windowBackground is your brand colour, and give SplashActivity that theme in the manifest. The colour then shows the moment the app opens, before the layout has loaded.
5. Make the splash open first
In AndroidManifest.xml, move the MAIN / LAUNCHER intent filter from MainActivity to SplashActivity.
6. Wait, then open the app
In SplashActivity, use a Handler to run code after 2 seconds: start MainActivity, then call finish() so Back doesn't return to the splash.
7. Don't open the app after the user has left
If the user leaves during those 2 seconds, cancel the delayed code in onDestroy with removeCallbacks. Otherwise MainActivity pops up later on its own.
8. Run it
The purple splash shows with your logo, then the home screen opens.
Good to know
Android 12 and later always show a short system splash (your app icon) first. With this approach users see that, then yours. For a single, modern splash, follow the Animated Splash Screen tutorial, which uses the SplashScreen API.
Keep the delay short. Two seconds is plenty; a splash should never hold up a user who wants to get going.
What's improved over the video
The background shows instantly through the theme, the delay is cancelled if the user leaves, and the splash finishes so Back doesn't return to it.
Files affected
Check what to add and what to replace before copying code.
packagecom.example.splashscreen;importandroid.os.Bundle;importandroidx.activity.EdgeToEdge;importandroidx.appcompat.app.AppCompatActivity;importandroidx.core.graphics.Insets;importandroidx.core.view.ViewCompat;importandroidx.core.view.WindowInsetsCompat;/** The app's real first screen, opened by SplashActivity. */publicclassMainActivityextendsAppCompatActivity{@OverrideprotectedvoidonCreate(Bundle savedInstanceState){super.onCreate(savedInstanceState);EdgeToEdge.enable(this);setContentView(R.layout.activity_main);ViewCompat.setOnApplyWindowInsetsListener(findViewById(R.id.main),(v, insets)->{Insets bars = insets.getInsets(WindowInsetsCompat.Type.systemBars());
v.setPadding(bars.left, bars.top, bars.right, bars.bottom);return insets;});}}