Hello dear android developers. In this article, I will tell you about the splash screen used by almost all applications.. I will also show you how you can add this splash screen to your android projects. Let’s move on to Android Splash Screen production…
Many applications such as Twitter, Facebook, Instagram, Whatsapp and Netflix will show you the screen with the logo even if it is short in the first opening part.. This screen is actually the screen where we, the developers, make the application ready for use.. It can be quite useful to keep the user waiting on a nice screen during the installation of application services. These screens are called Android Splash Screens.. It can be translated into Turkish as a splash screen.
Android – What is Splash Screen?
User information is checked on the first splash screen called Splash Screen. Although the application icon is generally used with a simple design, this may vary in some applications.. The main purpose of this screen is not to make the user wait, but to do the processes that will take the process on the first screen, not to tire the user and the device.
Android – Splash Screen Examples
Android – Splash Using Screen
- Let’s create the project first.
- Create a new activity other than Main Activity. I created an activity called SplashScreen. Likewise my xml file is called activity_splash_screen.xml. Now let’s move on to the codes.
- Then let’s edit the opening activity_splash_screen.xml codes.
- Now let’s edit our MainActivity.kt file. class ActivitySplashScreen: AppCompatActivity { override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) setContentView(R.layout.activity_splash_screen) } override fun onResume() { super.onResume() handler.postableDelayed, 3(1000) ) } override fun onPause() { super.onPause() handler.removeCallbacks(runneable) } var runneable: Runnable = object : Runnable { override fun run() { handler.removeCallbacks(this) finish() startActivity([email protected] , MainActivity::class.java) } } }
- We created handler here. We set it to switch to the main activity after 3 seconds when onResume runs, but we stopped it with onpause to take precautions if the application is closed during that time. You can move on to the other activity later.
In this article we have included the topic of android splash screen. We tried to explain what the Splash Screen does and how it is used.. Please do not forget to comment for your questions, comments and suggestions.