使ってみた
ScheduledExecutorService executor = Executors.newSingleThreadScheduledExecutor();
executor.scheduleWithFixedDelay(new Runnable(){
public void run() {
// update server (method which has asyncTask)
}
}, 0, 600, TimeUnit.SECONDS);
そして、モバイルがスリープすると動作しなくなります。私はalarmManagerを使用して同じことをしたいのですが、上記の要件に対してサービス、ブロードキャストサービス、またはアクティビティを使用する必要があるかどうかわかりません。
私を助けてください。
前もって感謝します。