Possible Duplicate:
Terminated Thread Revival
Thread threadWait = new Thread()
{
@Override
public void run() {
try {
sleep(10000);
sync = false;
} catch (InterruptedException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
};
I call this thread here:
threadWait.start();
while(sync){
//do something
}
when threadWait finished the state is TERMINATED. How i can start the thread another time? Any idea? THX TO ALL!
SOLUTION:
Runnable runWait = new Runnable(){
public void run(){
try {
Thread.sleep(10000);
sync = false;
} catch (InterruptedException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
};
and..
Thread first = new Thread(runWait);
first.start();