如何使用“thread”使我的进程等待另一个进程完成
谢谢
最佳答案
您可以使用join()
Thread t = new Thread(new Runnable() {
public void run() {
//some code
}
});
t.start();
t.join();//this will wait until Thread t completes its execution
关于java - 主线程等待,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/5231484/