---
title: How to Make an Android Splash Screen
description: Making a splash screen in Android doesn't have to be hard! Here's how it works.
image: https://blog.avenuecode.com/hubfs/smartphone-gf91951b52_1920.jpg
---

[AvenueCode.com](https://avenuecode.com) [News](https://avenuecode.com/news) [Contact](https://avenuecode.com/contact)

[![Avenue Code Snippets Logo](https://blog.avenuecode.com/hubfs/Avenue%20Code%20New%20Logos%20-%202023/AC-Snippets---Black.png)](https://blog.avenuecode.com/?hsLang=en-us) *menu*

- Technology
  
  [Cloud](https://blog.avenuecode.com/blog/topic/cloud?hsLang=en-us) [Delivery Infrastructure](https://blog.avenuecode.com/blog/topic/delivery-infrastructure?hsLang=en-us) [Web Experience](https://blog.avenuecode.com/blog/topic/web-experience?hsLang=en-us) [Agile Mindset](https://blog.avenuecode.com/blog/topic/agile-mindset?hsLang=en-us) [Quality First](https://blog.avenuecode.com/blog/topic/quality-first?hsLang=en-us)
  
  [Design](https://blog.avenuecode.com/blog/topic/design?hsLang=en-us) [Solution Architecture](https://blog.avenuecode.com/blog/topic/solution-architecture?hsLang=en-us) [Data & ML](https://blog.avenuecode.com/blog/topic/data-and-machine-learning?hsLang=en-us) [Mobile Experience](https://blog.avenuecode.com/blog/topic/mobile-experience?hsLang=en-us)
- [Whitepapers](https://blog.avenuecode.com/blog/topic/whitepapers?hsLang=en-us)
- [Spotlight](https://blog.avenuecode.com/blog/topic/spotlight?hsLang=en-us)
- [Extraordinary Women in Tech](https://blog.avenuecode.com/blog/topic/extraordinary-women-in-tech?hsLang=en-us)
- [Avenue Code Culture](https://blog.avenuecode.com/blog/topic/avenue-code-culture?hsLang=en-us)

- [Cloud](https://blog.avenuecode.com/blog/topic/cloud?hsLang=en-us)
- [Design](https://blog.avenuecode.com/blog/topic/design?hsLang=en-us)
- [Delivery Infrastructure](https://blog.avenuecode.com/blog/topic/delivery-infrastructure?hsLang=en-us)
- [Solution Architecture](https://blog.avenuecode.com/blog/topic/solution-architecture?hsLang=en-us)
- [Web Experience](https://blog.avenuecode.com/blog/topic/web-experience?hsLang=en-us)
- [Data & ML](https://blog.avenuecode.com/blog/topic/data-and-machine-learning?hsLang=en-us)
- [Agile Mindset](https://blog.avenuecode.com/blog/topic/agile-mindset?hsLang=en-us)
- [Mobile Experience](https://blog.avenuecode.com/blog/topic/mobile-experience?hsLang=en-us)
- [Quality First](https://blog.avenuecode.com/blog/topic/quality-first?hsLang=en-us)
- [Whitepapers](https://blog.avenuecode.com/blog/topic/whitepapers?hsLang=en-us)
- [Spotlight](https://blog.avenuecode.com/blog/topic/spotlight?hsLang=en-us)
- [Extraordinary Women in Tech](https://blog.avenuecode.com/blog/topic/extraordinary-women-in-tech?hsLang=en-us)
- [Avenue Code Culture](https://blog.avenuecode.com/blog/topic/avenue-code-culture?hsLang=en-us)

# [How to Make an Android Splash Screen](https://blog.avenuecode.com/how-to-make-an-android-splash-screen)

- [Tweet](https://twitter.com/share)

*perm\_identity* [Diego Cesar](https://blog.avenuecode.com/how-to-make-an-android-splash-screen/author/diego-cesar?hsLang=en-us)

*schedule* 11/30/22 2:00 PM

The splash screen is the first thing we notice when using any Android program. I struggled to find the right approach to Android development when I first started learning about it, but when the process was officially disclosed by the Android developer's team, the "issue" was resolved. This tutorial summarizes my learnings.

**Note:** Because Android development has used a "Kotlin-first" strategy since 2019, I'll solely demonstrate Kotlin in this tutorial. However, Java is also an option.

##### Starting Your Android Project

To create the project, you'll just need to follow the steps below:

- Create New Project > Empty Compose Activity
-  
- ![](https://lh3.googleusercontent.com/hfab2jA0LLv6buLL8DUX5n8OwYK1LQrS0s68ZQyMkh4ix4PyPX2PJR3Jb0ug6JoX63dmkK-1UAxB3nJlS-JXP4yOwzlnSsbJypdVgkCBYDAl9nRdxFZEGeEU_vdO0zY_NkLrqFUtUhBnS0VEd5yVE67DzAyV1-xv63uG0oK59GpRgP7FXZESR2RyaPawgA)
-  
- Then configure the project inserting its name, package, etc.
-  
- ![](https://lh6.googleusercontent.com/kFdcMwNqO_6mXL4eWfrhR1VX6qNTCXRxDjEhI3cLhiVTDwAD1NbitPtCTa5jShoGx_Ykb951TYUk3lNtNwWYFQrB3t0KQYYngmDonJ4z0sK1Rzc4PWXZ9FSFcPgPKM-9kAzq3m6aK_v_qCs5yH12zeH-hYNcOOXr8SXNUkk5Z4JlTbe4Dz9LJYgB3bjy1A)

With these basics in place, you're ready to implement the splash screen into your project.

##### Settings

Now we need to set up some configurations in our project.

**Build.gradle**

Your compileSdk needs to be at least 31, and you need to add the splash screen dependency.

```
android {   compileSdkVersion 32   //Other configuration}dependencies {   //Other dependencies   implementation 'androidx.core:core-splashscreen:1.0.0-rc01'}
```

##### Theme

It's also necessary to create a new theme, and you can do so by following the steps in the example below.

Please note that the theme from the Android operating system, **Theme.SplashScreen**, must be the parent of your theme. Additionally, you must set the theme of your following activity on the **postSplashScreenTheme** attribute.

```
<style name="Theme.App.SplashScreen" parent="Theme.SplashScreen">        <!-- Set the splash screen background, animated icon, and animation duration. -->        <item name="windowSplashScreenBackground">@color/white</item>        <!-- Use windowSplashScreenAnimatedIcon to add either a drawable or an             animated drawable. One of these is required. -->        <item name="windowSplashScreenAnimatedIcon">@drawable/ic_duck</item>        <!-- Required for animated icons -->        <!-- <item name="windowSplashScreenAnimationDuration">5000</item> -->        <!-- Set the theme of the Activity that directly follows your splash screen. -->        <!-- Required -->        <item name="postSplashScreenTheme">@style/Theme.SplashScreenApp</item></style>
```

**Note 1**: If you want to add a background color for your icon, you can use the theme: **Theme.SplashScreen.IconBackground** along with the attribute: **windowSplashScreenIconBackground**.

**Note 2**: The attribute **windowSplashScreenAnimationDuration** is only used with animations. For images, it's not necessary.

![](https://lh5.googleusercontent.com/GcIbmb9TaO_8BN66wn-OpfkCupe0YSvwekpARIqfUY0-5VsnXHpTLpslIreQ17ZhBGelCJbTnGbT1zCmSucF1GBvVYAYbCctffHmw5mRhLZ5wUQakXZFX-5giFD16W3Xu79YbjJN-Gi4JwabOEcf4DN7OBhZWuZQ2-5anfaFxqX9ZSdpJzn2M6ZCOWen3Q)

##### Manifest

This new theme must now be included in your application or activity. It's a personal preference, but I like to add it to the activity.

```
<application        android:allowBackup="true"        android:dataExtractionRules="@xml/data_extraction_rules"        android:fullBackupContent="@xml/backup_rules"        android:icon="@mipmap/ic_launcher"        android:label="@string/app_name"        android:roundIcon="@mipmap/ic_launcher_round"        android:supportsRtl="true"        android:theme="@style/Theme.SplashScreen"        tools:targetApi="31">        <activity            android:name=".MainActivity"            android:exported="true"            android:label="@string/app_name"            android:theme="@style/Theme.App.SplashScreen">            <intent-filter>                <action android:name="android.intent.action.MAIN" />                <category android:name="android.intent.category.LAUNCHER" />            </intent-filter>        </activity></application>
```

##### Activity

After **super.onCreate()** in your Activity, you must use the function **installSplashScreen()**. The method installSplashScreen() returns the splash screen object, so you can customize the behavior with these two methods: **setKeepOnScreenCondition** and **setOnExitAnimationListener**. Depending on the requirements of your project, you can employ one or more of these techniques. Let's look at both in turn.

**setKeepOnScreenCondition**

As its name implies, this method will continue to display the splash screen until something happens. In my situation, a viewModel is in charge of determining when the object will vanish.

```
class MainActivity : ComponentActivity() {    private val mainViewModel: MainViewModel by viewModels()    override fun onCreate(savedInstanceState: Bundle?) {        super.onCreate(savedInstanceState)        installSplashScreen().apply {            setKeepOnScreenCondition {                mainViewModel.isLoading.value            }        }        setContent {            SplashScreenTheme {                Box(                    modifier = Modifier.fillMaxSize(),                    contentAlignment = Alignment.Center                ) {                    Text(text = "Hello World!")                }            }        }    }}
```

 

**setOnExitAnimationListener**

In this case, you can do anything after your splash screen has finished. For instance, load data, check the cache, etc.

```
class MainActivity : ComponentActivity() {    override fun onCreate(savedInstanceState: Bundle?) {        super.onCreate(savedInstanceState)        installSplashScreen().apply {            setOnExitAnimationListener{                //Do something after the Splash Screen                it.remove()            }        }        setContent {            SplashScreenTheme {                Box(                    modifier = Modifier.fillMaxSize(),                    contentAlignment = Alignment.Center                ) {                    Text(text = "Hello World!")                }            }        }    }}
```

##### Conclusion

And that's all you need to know to make a splash screen in accordance with [the procedure](https://developer.android.com/develop/ui/views/launch/splash-screen/migrate) described on the official [Android Developers site](https://developer.android.com)! Tell me how it goes in the comments below.

---

### Author

# Diego Cesar

 Diego Cesar is an Android Engineer at Avenue Code. He has more than ten years of experience and enjoys learning about development, music, movies, and books.

---

### Related Posts

### Building Accessible Web Applications

[READ MORE](https://blog.avenuecode.com/building-accessible-web-applications?hsLang=en-us)

### Create a Tunnel from Anypoint Platform to GCP Using an HA VPN

[READ MORE](https://blog.avenuecode.com/create-a-tunnel-from-anypoint-platform-to-gcp-using-ha-vpn?hsLang=en-us)

### Create a Classic Tunnel from GCP to Anypoint Platform

[READ MORE](https://blog.avenuecode.com/create-a-classic-tunnel-from-gcp-to-anypoint-platform?hsLang=en-us)

### Leave a Comment!

### Avenue Code Social

[![Facebook Icon](https://blog.avenuecode.com/hubfs/Images/Blog/facebook.png?t=1486470796564)](https://www.facebook.com/avenuecode)

[![Twitter Icon](https://blog.avenuecode.com/hubfs/Images/Blog/twitter.png?t=1486470796842)](https://twitter.com/AvenueCode)

[![LinkedIn Icon](https://blog.avenuecode.com/hubfs/Images/Blog/linkedin.png?t=1486470796556)](https://www.linkedin.com/company/avenuecode/)

### Newsletter

Want to stay on top of all tips and news from Avenue Code?

### Popular Snippets

![Avenue Code-primary versions_logo white avenue code endorsement 2](https://blog.avenuecode.com/hs-fs/hubfs/Avenue%20Code%20New%20Logos%20-%202023/Avenue%20Code-primary%20versions_logo%20white%20avenue%20code%20endorsement%202.png?width=1180&name=Avenue%20Code-primary%20versions_logo%20white%20avenue%20code%20endorsement%202.png "Avenue Code-primary versions_logo white avenue code endorsement 2")

### About Us

- [Who We Are](https://www.avenuecode.com/who-we-are)
- [What We Do](https://www.avenuecode.com/what-we-do)
- [Portfolio](https://www.avenuecode.com/portfolio)
- [Partners](https://www.avenuecode.com/partners)
- [News](https://www.avenuecode.com/news)
- [Events](https://www.avenuecode.com/events)
- [Blog](https://blog.avenuecode.com/)
- [Contact](https://www.avenuecode.com/contact)

### Our Offices

San Francisco

[+1 415 766 4178](tel:+553125161448) [ac.inquiries@avenuecode.com](mailto:brazil.info@avenuecode.com)

Belo Horizonte

[+55 31 2516 1448](tel:+553125161448) [brazil.info@avenuecode.com](mailto:brazil.info@avenuecode.com)

São Paulo

[+55 11 3205 3232](tel:+553125161448) [brazil.info@avenuecode.com](mailto:brazil.info@avenuecode.com)

### We're Hiring!

- [Belo Horizonte](https://www.avenuecode.com/who-we-are)
- [New York](https://www.avenuecode.com/what-we-do)
- [San Francisco](https://www.avenuecode.com/portfolio)
- [São Paulo](https://www.avenuecode.com/partners)

---

©2015 - 2017 Avenue Code

[![Facebook Icon](https://blog.avenuecode.com/hubfs/Images/Icons/facebook-2.png)](https://www.facebook.com/avenuecode) [![Twitter Icon](https://blog.avenuecode.com/hubfs/Images/Icons/twitter-2.png)](https://twitter.com/AvenueCode) [![LinkedIn Icon](https://blog.avenuecode.com/hubfs/Images/Icons/linkedin-2.png)](https://www.linkedin.com/company/avenue-code) [![Glassdoor Icon](https://blog.avenuecode.com/hubfs/Images/Icons/glassdoor-icon-1.png)](https://www.glassdoor.com/Overview/Working-at-Avenue-Code-EI_IE456173.11,22.htm) [![YouTube Icon](https://blog.avenuecode.com/hubfs/Images/Icons/youtube-2.png)](https://www.youtube.com/user/AvenueCodePlay)

Please enable JavaScript to view the [comments powered by Disqus.](http://disqus.com/?ref_noscript)

© 2026 Avenue Code

```json
{
  "@context" : "https://schema.org",
  "@type" : "BlogPosting",
  "author" : {
    "@type" : "Person",
    "name" : "Diego Cesar",
    "url" : "https://blog.avenuecode.com/author/diego-cesar"
  },
  "dateModified" : "2022-11-30T17:00:00.611Z",
  "datePublished" : "2022-11-30T17:00:00.000Z",
  "headline" : "How to Make an Android Splash Screen",
  "image" : [ "https://blog.avenuecode.com/hubfs/smartphone-gf91951b52_1920.jpg" ],
  "mainEntityOfPage" : {
    "@id" : "https://blog.avenuecode.com/how-to-make-an-android-splash-screen",
    "@type" : "WebPage"
  },
  "publisher" : {
    "@type" : "Organization",
    "logo" : {
      "@type" : "ImageObject",
      "url" : "https://blog.avenuecode.com/hubfs/Avenue%20Code%20New%20Logos%20-%202023/Avenue%20Code-primary%20versions_LOGO%20HORIZONTAL%20group%201-7.png"
    },
    "name" : "Avenue Code"
  }
}
```