AsyncTask warten lassen

S

samarek

Fortgeschrittenes Mitglied
2
Hi

ich würd gern meinen AsyncTask eine Sekunde warten lassen.
Bekomme allerdings beim Aufruf von wait(long milli) diesen Fehler

Code:
11-24 15:46:29.240: VERBOSE/Exception(25800): java.lang.IllegalMonitorStateException: object not locked by thread before wait()
11-24 15:46:29.240: VERBOSE/Exception(25800):     at java.lang.Object.wait(Native Method)
11-24 15:46:29.240: VERBOSE/Exception(25800):     at java.lang.Object.wait(Object.java:395)
11-24 15:46:29.240: VERBOSE/Exception(25800):     at aha.pa.kommunikation.Json.liesJsonProducts(Json.java:389)
11-24 15:46:29.240: VERBOSE/Exception(25800):     at aha.pa.kommunikation.Json$ProductTask.doInBackground(Json.java:108)
11-24 15:46:29.240: VERBOSE/Exception(25800):     at aha.pa.kommunikation.Json$ProductTask.doInBackground(Json.java:1)
11-24 15:46:29.240: VERBOSE/Exception(25800):     at android.os.AsyncTask$2.call(AsyncTask.java:185)
11-24 15:46:29.240: VERBOSE/Exception(25800):     at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:306)
11-24 15:46:29.240: VERBOSE/Exception(25800):     at java.util.concurrent.FutureTask.run(FutureTask.java:138)
11-24 15:46:29.240: VERBOSE/Exception(25800):     at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1088)
11-24 15:46:29.240: VERBOSE/Exception(25800):     at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:581)
11-24 15:46:29.240: VERBOSE/Exception(25800):     at java.lang.Thread.run(Thread.java:1019)

kann mir da mal grad jemand weiterhelfen?
 
Thread.sleep(1000);

google hätte geholfen :D
 

Ähnliche Themen

S
Antworten
9
Aufrufe
1.213
swa00
swa00
M
Antworten
8
Aufrufe
1.685
swa00
swa00
Zurück
Oben Unten