Exemplo n.º 1
0
        private void OnCallForwardingResetAlarm()
        {
            StartActivity(IntentFactory.CreateResetCallForwardingIntent());

            Analytics.TrackEvent("Alarm Erased", new Dictionary <string, string> {
                { "ErasedDateTime", DateTime.Now.FormatDateTime() }
            });
        }
Exemplo n.º 2
0
        private void ScheduleCallForwardingResetAlarm()
        {
            var alarmDate    = timePicker.ToCompatFutureDateTime(IsPhoneMarshmallowOrAbove);
            var alarmManager = (AlarmManager)GetSystemService(AlarmService);

            alarmManager
            .SetExactAndAllowWhileIdle(
                AlarmType.RtcWakeup,
                alarmDate.ToUniversalTime().ToEpochMilliseconds(),
                IntentFactory.CreateWakeOnAlarmIntent(this));

            ShowToast($"Scheduled for {alarmDate.FormatDateTime()}");
            ShowToast($"{alarmDate.GetTimeRemaining()} remaining.");

            Analytics.TrackEvent("Alarm Scheduled", new Dictionary <string, string> {
                { "ScheduleDateTime", alarmDate.FormatDateTime() }
            });
        }