Skip to content Skip to sidebar Skip to footer

How To Make Setcontentview() Work Properly With A Thread?

I have 2 layouts, and 2 activities, each one corresponding to a layout, one of them is SplashActivity, and the other is MainActivity. I want the application to open the splashActiv

Solution 1:

your problem is that you are calling timer.run(); instead of timer.start();

timer.run(); calls the run method on the same context of the thread that executed that line (making the UI Thread, in your case, wait for 5s, and blocking every other operation). timer.start() spawns a new thread

Post a Comment for "How To Make Setcontentview() Work Properly With A Thread?"