嗨,我想更新在15分钟的时间间隔,特别是在15分钟的当前时间基础上在后台运行的服务。如何在每15分钟的当前时间每15分钟运行一次android服务?
服务:
public class UpdateService extends IntentService {
public UpdateService() {
super("UpdateService");
}
// will be called asynchronously by Android
@Override
protected void onHandleIntent(Intent intent) {
updateFragmentUI();
}
private void updateFragmentUI() {
this.sendBroadcast(new Intent().setAction("UpdateChart"));
}
}
可以使用[的jobscheduler](https://developer.android.com/reference/android/app/job/JobScheduler.html)对于API 21和上述 –
看' evernote/android-job' – EpicPandaForce