スレッドを開始できない理由がわかりません。どうすればよいですか?
scheduleTaskExecutor = Executors.newScheduledThreadPool(1);
scheduleTaskExecutor.scheduleAtFixedRate(runUpdatePreOrders, 0,
timeRepeat, TimeUnit.MILLISECONDS);
private Runnable runUpdatePreOrders = new Runnable() {
public void run() {
synchronized (runUpdatePreOrders) {
try {
if (pause) wait();
} catch (InterruptedException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
new UpdateOrders(min_price, listener).execute();
Log.e("UpdateBrodcast", "StartPreOrder");
}
}
};
@Override
public void onStart() {
super.onStart();
if (pause) {
runUpdatePreOrders.notify(); // this IllegalMonitorStateException: object not locked by thread before
}
pause = false;
}