AADTechnical AADTechnical - 9 months ago 44
Android Question

Android Splash screen duration

We are using the splash screen to show the company logo every time user open the app. Currently, we are showing the splash screen for 3 Seconds.

Below is the code:

private static int SPLASH_TIME_OUT = 3000; // Delay of 3 Seconds

protected void onCreate(Bundle savedInstanceState) {

new Handler().postDelayed(new Runnable() {
public void run() {
// This method will be executed once the timer is over
Intent i = new Intent(SplashScreenActivity.this, AnotheActivity.class);
// close this activity

But this splash screen duration is just randomly chosen within team.
We kind-of know that Splash screen in general is not all that encouraged in Android app ecosystem, but since this is our app's need, hence it is implemented.

My Question: Is there any standard Android guideline/best practice for choosing the RIGHT splash screen duration time?

Answer Source

A better option is to use a splash screen activity with a custom theme, that starts the main content activity. With this there is no need to use a timer, as it switches to main content when the app is ready, and in the meantime shows a picture that is inside the theme.

Here is tutorial how to do it - https://www.bignerdranch.com/blog/splash-screens-the-right-way/

Main parts from the tutorial:

    android:theme="@style/SplashTheme"> THEME HERE!!!
        <action android:name="android.intent.action.MAIN" />

        <category android:name="android.intent.category.LAUNCHER" />

public class SplashActivity extends AppCompatActivity {

    protected void onCreate(Bundle savedInstanceState) {

        Intent intent = new Intent(this, MainActivity.class);

<style name="SplashTheme" parent="Theme.AppCompat.DayNight.NoActionBar">
    <item name="android:windowBackground">@drawable/splash</item>


<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">







It is even possible to add the style to the application, without a need to use a separate activity.