In my Android app I am trying to execute a task every 5 seconds.
I tried doing something like this:
@Override
public void onCreate() {
//standard initialization code
letsChange(); //method name
try{
Waitwait(1000);
} catch(Exception e) {
e.printstackstrace();
}
}
But I get the following error message: java.lang.IllegalMonitorStateException: object not locked by thread before wait()
java.lang.IllegalMonitorStateException: object not locked by thread before wait()
What do I do to stop this?