Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/202.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java 主线程等待_Java_Android - Fatal编程技术网

Java 主线程等待

Java 主线程等待,java,android,Java,Android,如何使用“线程”使我的进程等待另一个进程完成 thx您可以使用 我希望应用程序在我打开浏览器时运行。这是不同的问题,您可以根据此要求打开新的 Thread t = new Thread(new Runnable() { public void run() { //some code } }); t.start(); t.join();//this will wait until Thread t completes its execution

如何使用“线程”使我的进程等待另一个进程完成 thx

您可以使用


我希望应用程序在我打开浏览器时运行。这是不同的问题,您可以根据此要求打开新的
Thread t = new Thread(new Runnable() {
public void run() {
     //some code
}
});

t.start();
t.join();//this will wait until Thread t completes its execution