Creating Splash screen
The first example(a basic splash screen) is not the most efficient way to handle it. As such, it is basic splash screen.
A basic splash screen
A splash screen is just like any other activity, but it can handle all of your startup-needs in the background. Example:
Now our splash-screen will be called as the first activity.
Here is an example splashscreen that also handles some critical app elements:
Splash screen with animation
This example shows a simple but effective splash screen with animation that can be created by using Android Studio.
Step 1: Create an animation
Create a new directory named anim in the res directory. Right-click it and create a new Animation Resource file named fade_in.xml:
Then, put the following code into the fade_in.xml file:
Step 2: Create an activity
Create an empty activity using Android Studio named
Splash. Then, put the following code into it:
Next, put the following code into the layout file:
Step 3: Replace the default launcher
Splash activity into a launcher by adding the following code to the AndroidManifest file:
Then, remove the default launcher activity by removing the following code from the AndroidManifest file:
This modified text is an extract of the original Stack Overflow Documentation created by following contributors
and released under CC BY-SA 3.0