Note: This was meant to be more of a "how to read the dumpsys alarm output"
question, than a "help me find problems in my code" question.
But the code might be also relevant (and problematic), so here it is. Sorry
for C# :)
Calendar calendar = Calendar.Instance;
// Constructs a new instance of the Calendar subclass appropriate for the
default Locale and default TimeZone, set to the current date and time.
calendar.Set(CalendarField.Year, triggerTime.Year);
calendar.Set(CalendarField.Month, triggerTime.Month - 1);
calendar.Set(CalendarField.DayOfMonth, triggerTime.Day);
calendar.Set(CalendarField.HourOfDay, triggerTime.Hour);
calendar.Set(CalendarField.Minute, triggerTime.Minute);
calendar.Set(CalendarField.Second, triggerTime.Second);
Intent ringIntent = new Intent(Application.Context, typeof(
RingBroadcastReceiver));
ringIntent.PutExtra("ID", alarm.Id);
PendingIntent ringPendingIntent = PendingIntent.GetBroadcast
(Application.Context, requestCode, ringIntent, PendingIntentFlags.
UpdateCurrent);
if (Build.VERSION.SdkInt >= BuildVersionCodes.Lollipop)
{
var alarmEditIntent = new Intent(Application.Context,
typeof(AlarmActivity));
alarmEditIntent.PutExtra("GOTO", alarm.Id);
var alarmEditPendingIntent = PendingIntent.GetActivity
(Application.Context, requestCode, alarmEditIntent,
PendingIntentFlags.CancelCurrent);
var alarmInfo = new AlarmManager.AlarmClockInfo(triggerAtMillis ,
alarmEditPendingIntent);
manager.SetAlarmClock(alarmInfo, ringPendingIntent);
}
else if (Build.VERSION.SdkInt >= BuildVersionCodes.Kitkat)
manager.SetExact(AlarmType.RtcWakeup, triggerAtMillis, ringPendingIntent);
else
manager.Set(AlarmType.RtcWakeup, triggerAtMillis, ringPendingIntent);
--
You received this message because you are subscribed to the Google Groups
"Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/android-developers.
To view this discussion on the web visit
https://groups.google.com/d/msgid/android-developers/3c9b9fe8-184b-422d-ad7e-cefe61dd2745%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.