How to Create Welcome Screen (Splash Screen) in Android Studio

INTRO MUSIC PLAYING♪ Hey welcome all! Today we’re going to build a welcome screen for android application. So go to the MainActivity And just add the time interval for our… Welcome screen, that is
‘private static int SPLASH_TIMEOUT’ then it is, I am just giving it as 4000 milliseconds which is 4 seconds. Okay, next.. Ah,, just below the ‘setContentView’ , we
add the ‘new Handler ‘new Handler().postDelayed’ new Runnable() and just Alt-Enter on the Handler as you can see, here in the import we have
‘import android.os.Handler;’ next we type @Override public void run() and here goes our Intent to open the next activity, so type Intent. I’m just naming it as ‘homeIntent’=new Intent(MainActivity.this, HomeActivity.class); startActivity(homeIntent); then finish(); and here,.. We… add the splash timeout, And here we go! That’s it!! And the HomeActivity should be created right now. So go to layout>right click>new>Activity Activity>Empty Activity I am justing creating empty, you can create anything like this… Naming it as ‘HomeActivity’ with the package name of your app. Then click the finish. see that the HomeActivity is now clear. [RECORDING ON HALF-SLEEP MODE] This is welcome screen Backgr.. ound.. Same in the activity_home.. Bring it into the center so add
‘ android:gravity=”center” ‘ As you can see after
four seconds it turned the activity! So Thanks for Watching this video I hope
you have enjoyed subscribe have a nice thanks for watching this video I hope
you have enjoyed subscribe have a nice

, , , , , , , , , , , , , , , , , ,

Post navigation

59 thoughts on “How to Create Welcome Screen (Splash Screen) in Android Studio

  1. hey bro please help after showing the splash screen the app crash it is not taking to the homeIntent i have followed all your step and code perfectly but it is not working and i am not testing my app on avd i am testing on a 5.0.1 android device i have all so installed the sdk please help

  2. sabith please make a video on custom search popup overlay onclick search bar on main page (in apps like zomato uber)

  3. If you artificially wait to start an application, I will uninstall it.
    FWIW, Google has suggested a better way of doing a splash screen, using themes.

  4. tanx, its easy and usefull, i have a question, in this way, it work on every device with different speed? and it wont any problem?

  5. Thats not good as user needs to wait for a bit more and user still sees a white blank page.

    There's a better way.
    Create a new activity.
    Delete its activity layout.
    Remove setContentView (…);
    Create a new <style …./> with item as windowBackground and specify a image which is your app logo.
    Then in that activity, use setTheme(;
    And finally, do not forget to set this activity as launcher.

  6. bro the splash screen dont end it doesnt swith to main activity i used a nav bar in main activity is that the problem?

  7. Hello thanks for your nice video, I did exactly what you show in the video but then may MainActivity is the one remain for 4 seconds while the HomeActivity is the one stay. How to solve that?

  8. About removing the title bar:
    It didn't work for me; neither did anything on the Internet unless I made my welcome activity extend Activity, instead of AppCompatActivity. As I did this, the title bar magically disappeared itself, without any extra code nor XML changes. I only added
    super.getWindow().getDecorView().setSystemUiVisibility( View.SYSTEM_UI_FLAG_FULLSCREEN );
    to my onCreate method (between super.onCreate and super.setContentView invokations), which removed the notification bar.

  9. Hey there!! I am almost done with my project and now wants to add a splash screen at the starting of the project! so can guide me for the same??

  10. sir i need help. i want to add spinner in list view but still error in adapter of spinner.
    so pilz sir reply me

  11. I want polish to turn on bluetooth when i put a lock screen for mobile to send and receive from erduino and thank you

  12. Hey this is really cool! ^^

    Anyway, i was hoping if i could get some feedback on this open source android app I have posted below? I am a beginner and hope to learn on how to improve it…

    Just search ' pub:Path Ahead ' in Google Play Store (P & A are case sensitive).

    Looking-forward 🙂

  13. aren't splash activities meant to actually do something useful instead of forcing user to wait for nothing?

  14. Hi sabith, hope you're doing well. i wanted to tell you that if anything i've learned in andriod or in anything i got stuck into. you're the one who helped. For me your way of dealing with code and everythhing was the easiest way to learn. Thank you so much for your guidance and i would need your help in future. Will you help me with few things in andriod?

Leave a Reply

Your email address will not be published. Required fields are marked *