我正在尝试将存储在Sqlite中的时间列表(它有小时和分钟)检索到警报管理器中以通过通知执行提醒.我的方法是将存储在Sqlite中的所有预定时间循环到警报管理器中,以根据存储的时间列表执行通知,但通知不会发出蜂鸣声.
但是,当我指定一次(小时和分钟)时,它可以工作.下面是有效的代码示例,但我不想这样:
alarmManager = (AlarmManager) getSystemService(ALARM_SERVICE);
Calendar calendar = Calendar.getInstance();
calendar.set(Calendar.HOUR_OF_DAY, 10);
calendar.set(Calendar.MINUTE, 45);
Intent myIntent = new Intent(ListRemainder.this, AlarmReceiver.class);
pendingIntent = PendingIntent.getBroadcast(ListRemainder.this, 0, myIntent, 0);
alarmManager.set(AlarmManager.RTC, calendar.getTimeInMillis(), pendingIntent);
但是当涉及循环几个时间表它不起作用,这是我想要的方法,下面是代码示例,我缺少什么?
//listOfTime is the one which contains the list of stored scheduled time in Sqlite.
for (int i = 0; i < listOfTime.size(); i++) {
int hour = Integer.parseInt(listOfTime.get(i).toString().substri