checkAndStopWorkingThread();
workingThread = new Thread() { public void run() { ...... } ;};workingThread.start();
private void checkAndStopWorkingThread() { if (workingThread != null) { workingThread.stop(); workingThread = null; }}