deprecated thread methods are not supported

前端 未结 3 937
轻奢々
轻奢々 2020-12-06 15:35

I am making one project where i need to display Home page and when home page displays, after that or continue with that 3 to 5 seconds my other welcome custom dialog is disp

3条回答
  •  一向
    一向 (楼主)
    2020-12-06 15:37

    Put this best way to do splash screen

    int SPLASH_TIME = 1300;
        Handler HANDLER = new Handler();
    
                        // thread for displaying the SplashScreen
                        HANDLER.postDelayed(new Runnable() {
                            @Override
                            public void run() {
                             finish();
                             startActivity (new Intent(getApplicationContext(),Alpha.class));
                            }
                          }, SPLASH_TIME);
    

提交回复
热议问题