I want to start a Thread (in Java). This Thread should be to execute every 5 minutes. This Thread, start the method, if the method return true, I want to stop the Thread. I'm not able to do this. This is my code:
Timer timer = new Timer();
timer.schedule( new TimerTask()
{
public void run() {
verificaAssistenza ass = new verificaAssistenza();
if(ass.checkAssistenza())
//I WANT TO STOP THE THREAD
}
}, 0, 60*(1000*1));