if(Thread.currentThread().isInterrupted()) {
//reset variables here
}
或:
if(Thread.interrupted()) {
//reset variables here
}
有人可以帮我吗?预先感谢您!您可以将您的整个物品包裹在一个trycatch块中:
try {
//Code here
} catch (InterruptedException e) {
//Reset variables here
}