我已经创建了一个有特定时间段的饮食图arrayList,现在我想创建一个提醒,它将通知什么时候是特定的饮食与声音。
发布于 2015-02-13 11:04:07
虽然这个问题有点老,但它仍然可以帮助其他用户。您必须使用警报管理器在特定的时间触发。
Intent intent = new Intent(this, MyService.class);
PendingIntent pintent = PendingIntent.getService(this, 0, intent, 0);
AlarmManager alarm = (AlarmManager) getSystemService(Context.ALARM_SERVICE);
alarm.setRepeating(AlarmManager.RTC_WAKEUP,<here set time when you want to trigger>,<here you can set time to repeat after trigering continusosly>,pintent); https://stackoverflow.com/questions/27955955
复制相似问题