How can I wait for 10 second without locking application UI in android [duplicate]
问题 This question already has an answer here: How do you have the code pause for a couple of seconds in android? 1 answer I am stuck with a problem, I want to wait 10 second because I want my application to start the code below after that 10 sec but without stopping that person from clicking anything else in the application ( without calling Thread.sleep(); ). try { Log.v("msg", "WAIT CheckFrequencyRun"); Thread.sleep(10000); // giving time to connect to wifi } catch (InterruptedException e) { //