---
title: "I wanted to do show a splash screen in my application only once for the first time when user downloads my   application. How do you design it? What logic will you use for it?"  
description: "I wanted to do show a splash screen in my application only once for the first time when user downloads my   application. How do you design it? What logic will you use for it?"  
author: "Shray singh"  
published: 2018-01-22  
updated: 2018-01-22  
canonical: https://answers.mindstick.com/qa/33372/i-wanted-to-do-show-a-splash-screen-in-my-application-only-once-for-the-first-time-when-user-downloads-my-application-how-do-you-design-it-what-logic-will-you-use-for-it  
category: "technology"  
tags: ["android"]  
reading_time: 1 minute  

---

#  I wanted to do show a splash screen in my application only once for the first time when user downloads my   application. How do you design it? What logic will you use for it?

I wanted to do show a splash [screen](https://www.mindstick.com/forum/1382/print-something-that-is-not-shown-on-the-screen-using-wpf) in my [application](https://www.mindstick.com/blog/59/xaml-extensible-application-markup-language) only once for the first time when a [user](https://www.mindstick.com/articles/13001/multi-statement-table-valued-user-defined-function-in-sql-server) downloads my application. How do you [design](https://www.mindstick.com/articles/126148/the-way-to-merge-psd-style-and-design-in-to-reactive-html) it? What [logic](https://www.mindstick.com/articles/331924/best-ways-to-improve-your-logic-building-skills-for-programming) will you use for it?

## Answers

### Answer by Prateek sharma

to use a splash screen in your android application you need two things -

1. make a xml file which contains the designing part
2. your logic part in java such as for how long you want to show your screen.

\

## a sample of an XML file

<?xml version="1.0" encoding="utf-8"?>

<layer-list xmlns:android="http://schemas.android.com/apk/res/android">

<item android:drawable="@color/back" />

<item>

<bitmap android:src="@drawable/logo"

android:gravity="center" />

</item>

</layer-list>

\

## you Splash Activity can contain code

public class SplashActivity extends AppCompatActivity {

private static int SPLASH_TIME_OUT = 1000;

@Override

protected void onCreate(Bundle savedInstances){

super.onCreate(savedInstances);

new Handler().postDelayed(new Runnable() {

@Override

public void run() {

// This method will be executed once the timer is over

// Start your app main activity

Intent i = new Intent(getApplicationContext (), MainActivity.class);

startActivity(i);

// close this activity

finish();

}

}, SPLASH_TIME_OUT);

}

}

you need to make sure that you set your **SplashActivty** as **launcher activity** in your app manifest file.


---

Original Source: https://answers.mindstick.com/qa/33372/i-wanted-to-do-show-a-splash-screen-in-my-application-only-once-for-the-first-time-when-user-downloads-my-application-how-do-you-design-it-what-logic-will-you-use-for-it

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
