通过单击事件开启线程时,再次单击就会出现 java.lang.IllegalThreadStateException:
Thread already started. 错误
解决办法:
创建一个Runnable:
Runnable DownloadRunnable = new
Runnable() {
@Override
public void run() {
//需要处理操作
}
然后每次需要调用的时候会重新new一个Thread:
new Thread(DownloadRunnable).start();
遇到java.lang.IllegalThreadStateException: Thread already started.
错误的解决办法,布布扣,bubuko.com
遇到java.lang.IllegalThreadStateException: Thread already started.
错误的解决办法
时间: 2025-01-04 00:19:16