Android App Development
iOS App Development
Flutter App Development
Cross Platform App Development
Hire on-demand project developers and turn your idea into working reality.
Big thanks to Webkul and his team for helping get Opencart 3.0.3.7 release ready!
Deniel Kerr
Founder. Opencart
Top Partners
In this blog, We are going to implement Simple Splash Screen in Android using styles.
There are two commonly used methods to implement the splash screen in android.
1st Method (Bad Way): We can add splash by using timmer. In this approach, We create a new thread for the delay for a specific time like 2/3 sec. Once the delay is completed then it opens the main activity and finishes itself by calling finish().
The above-mentioned approach is not correct.
2nd Method (Right way): Using a Launcher Theme. Application theme is instantiated before the layout is created. So, we will just set a custom theme in Manifest for our splash activity.
Application theme
Step 1:
First of all, We have to create a drawable resource file that must be layer-list type. In that, we will use a bitmap tag to show the image.
drawable/splash_background.xml
Step 2:
Create a new Style for SplashActivity in res/values/themes.xml
Step 3:
Set “mySplashStyle” the theme for SplashActivity in AndroidManifest.xml
Step 4:
Launch the MainActivity by using Intent in onCreate() and finish the SplashActivity.
Here we have done. I hope, this blog will be helpful to you.
My Other Blogs: https://mobikul.com/author/anandkashyap/
Your email address will not be published. Required fields are marked*
Name*
Email*
Save my name email and website in this browser for the next time I comment.
Be the first to comment.
We use cookies to personalize your experience. By continuing to visit this website you agree to our use of cookies. Learn more about privacy policy
Excellent work, fast, good quality and understood the brief perfectly! Quick responses developing the project and very good cooperation. I suggest to anyone.
Stathis Plakidas
USA
India
Global
Name
Email
Enquiry or Requirement
If you have more details or questions, you can reply to the received confirmation email.