80,350
社区成员
发帖
与我相关
我的任务
分享
String threadName = "download";
for (Thread t : Thread.getAllStackTraces().keySet()) {
System.out.println("------------------------------"+t.getName());
if (t.getName().equals(threadName)) {
t.interrupt();//进不来这里
}
}
Thread thread = new Thread(new Runnable() {
@Override
public void run() {
try {
Download.download(strResult, handler);
} catch (Exception e) {
e.printStackTrace();
}
}
},threadName);
thread.start();