Interrupt the Thread
using it thread id
Thread[] threads = new Thread[threadGroup.activeCount()];
threadGroup.enumerate(threads);
for (Thread thread: threads){
if ( thread != null && thread.getId() == threadID ){
if ( Thread.State.RUNNABLE != thread.getState()){
try{
thread.interrupt();
return true;
} catch (Throwable t){
; // Swallow any exceptions.
}
}
}
}
return false;