如何为列表添加一个每天重复的复选框的提醒? 我知道我写错了但我无法解决它请帮助
checkBox.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton compoundButton, boolean isChecked) {
editor.putBoolean("CheckValue"+position, isChecked);
editor.apply();
if (isChecked) {
Calendar updateTime = Calendar.getInstance();
updateTime.setTimeZone(TimeZone.getTimeZone("GMT+5:00"));
updateTime.set(Calendar.HOUR_OF_DAY, 20);
updateTime.set(Calendar.MINUTE, 40);
if(System.currentTimeMillis() <= updateTime.getTimeInMillis()){
constractJob();
}
amd这是constractJob
private void constractJob(){
JobInfo.Builder builder = new JobInfo.Builder(JOBID,new ComponentName(context, MyService.class));
builder.setRequiredNetworkType(JobInfo.NETWORK_TYPE_UNMETERED)
.setPersisted(true);
mJobScheduler.schedule(builder.build());
}
这是我的服务,tatarka正在开发api低于棒棒糖
public class MyService extends me.tatarka.support.job.JobService {
@Override
public boolean onStartJob(me.tatarka.support.job.JobParameters params) {
PugNotification.with(this).load()
.title("title")
.message("message")
.bigTextStyle("bigi")
.smallIcon(R.drawable.pugnotification_ic_launcher)
.largeIcon(R.drawable.pugnotification_ic_launcher)
.flags(Notification.DEFAULT_ALL)
.simple()
.build();
return true;
}
@Override
public boolean onStopJob(me.tatarka.support.job.JobParameters params) {
return true;
}
抱歉英语不好