0
我用這種方法設置告警管理:如何在android中設置鬧鐘管理器一致?
public void setAlarmManager(Context context, Intent intent, long repeat) {
PendingIntent pendingIntent;
pendingIntent = PendingIntent.getService(context, 0, intent, 0);
AlarmManager alarmManager = (AlarmManager) context
.getSystemService(context.ALARM_SERVICE);
Calendar calendar = Calendar.getInstance();
calendar.setTimeInMillis(System.currentTimeMillis());
calendar.add(Calendar.SECOND, 10);
alarmManager.setRepeating(AlarmManager.RTC_WAKEUP,
calendar.getTimeInMillis(), repeat, pendingIntent);
}
這個方法,我時間。但一個固定時間後發送短信的具體數字此方法不留consistent.Specially當去睡眠模式它不工作,我可以使這個連續,它也將工作在睡眠模式?