Štěpán Záliš Štěpán Záliš - 1 year ago 124
Android Question

Splash screen Android

I am beginner and I would like to show splash screen, but my boss wants to use Fragment. I do not know how to implement it in my MainActivity. I know that I have to use handler with time and stack layout, but I have not found how.

Answer Source

If you want to add a Splash Screen as a Fragment inside your MainActivity

  1. Add a FrameLayout to your MainActivity, inside the FrameLayout, make a Layout for your Views, and insert a Fragment which holds your SplashScreen Display (Make sure your Fragment is in the bottom of the MainActivity, so that its displayed over your layout)




         //Your UI goes here        


      Your Fragment with Splash Screen Goes here 

  1. In side your FragmentActivity do this

     new Handler()..postDelayed(new Runnable() {
        public void run() { 
           Intent intent = getActivity().getIntent();
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download