接收者的onReceive永远不会运行
adb shell dumpsys alarm 显示警报未设置
设置闹钟的代码(此代码已运行):
Intent i = new Intent(context, typeof(UpdateTask));
PendingIntent pi = PendingIntent.GetService(context, 0, i, 0);
AlarmManager alarmMgr = (AlarmManager)context.GetSystemService(Context.AlarmService);
alarmMgr.SetInexactRepeating(AlarmType.RtcWakeup,
SystemClock.ElapsedRealtime(),
60 * 1000, pi);
应该启动的BroadcastReceiver定义如下:
[BroadcastReceiver]
class UpdateTask : BroadcastReceiver {
public override void OnReceive(Context context, Intent intent) {
[...]