我累了查找有关报警的具体日子,总是天天跑恳求谁可以帮我 并使用这些代码,这个是什么错误,运行每所以我发送dayOfWeek = 1;但每天跑报警在特定日子不是每天例如重复(周日,周二,周五)
public void setAlarm(int dayOfWeek) {
Toast.makeText(getApplicationContext(), dayOfWeek+","+h+","+m, 22222).show();
cal1.set(Calendar.DAY_OF_WEEK, dayOfWeek);
cal1.set(Calendar.HOUR, 11);
cal1.set(Calendar.MINUTE, 0);
cal1.set(Calendar.SECOND, 0);
cal1.set(Calendar.MILLISECOND, 0);
Intent intent = new Intent(this, RemmemberActivity.class);
PendingIntent pendingIntent0 = PendingIntent.getBroadcast(this, 0,
intent, 0);
pendingIntent = PendingIntent.getActivity(this, 12345,
intent, PendingIntent.FLAG_UPDATE_CURRENT);
Long alarmTime = cal1.getTimeInMillis();
am = (AlarmManager) getSystemService(Activity.ALARM_SERVICE);
am.setRepeating(AlarmManager.RTC_WAKEUP, alarmTime,24 * 60 * 60 * 1000 , pendingIntent);
}
确定,但我没有固定3天(太阳,周二,周五),可能是三个不同天根据复选框选择像一个(周一,周三,周六) – 2014-09-14 06:51:32
好吧,我用这条线和每周六罚款am.setRepeating(AlarmManager.RTC_WAKEUP,alarmTime,7 * 24 * 60 * 60 * 1000,pendingIntent);但怎么可以设置每个星期天 – 2014-09-14 07:41:03
谢谢你的帮助:) :) – 2014-09-14 08:32:49