Run progress bar while switching Activity

后端 未结 4 1642
死守一世寂寞
死守一世寂寞 2020-12-20 08:16

im stuck in a situation where i am switching from activity 1 to activity 2. i am using Thread.sleep(5000) to start another activity after 5 seconds But the progress bar whic

4条回答
  •  死守一世寂寞
    2020-12-20 08:40

    First of all in the Above code, you need to start the Thread using this.

    t.start();

    you can also try below code,

    new Thread ( new Runnable() 
    {
            public void run()
            {
               // Place your Intent Code here
            }
    }.start();
    

提交回复
热议问题