Xamarin Android Alarm Manager Issue

You are setting the time to trigger the alarm in the past by only using the timespan of 10 minutes, the number of milliseconds needs to be calculated from the beginning of the year 1970.

If the stated trigger time is in the past, the alarm will be triggered immediately.

Get the current time, and add time to it.

var TenMinsFromNow = Calendar.GetInstance(Android.Icu.Util.TimeZone.Default).TimeInMillis + TimeSpan.FromMinutes(10).TotalMilliseconds);

Current time in milliseconds from “1970-01-01T00:00:00Z”:

 Java.Lang.JavaSystem.CurrentTimeMillis();

Or:

 Calendar.GetInstance(Android.Icu.Util.TimeZone.Default).TimeInMillis;

Leave a Comment