• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Apps Unable to receive android.intent.action.EVENT_REMINDER broadcast

eshayne

Lurker
I would like to write an application that is triggered when a calendar reminder occurs. I realize there is no officially documented way of doing this, but I have seen in the log that when my calendar alarm goes off on my phone (Droid X), AlertReceiver indicates that it has received an android.intent.action.EVENT_REMINDER:

Code:
01-03 11:03:00.029 D 1523 AlertReceiver onReceive: a=android.intent.action.EVENT_REMINDER Intent { act=android.intent.action.EVENT_REMINDER dat=content://com.android.calendar/129407058000 flg=0x4 cmp=com.android.calendar/.AlertReceiver (has extras) }
So, I set up a simple BroadcastReceiver:

Code:
package com.eshayne.android;

import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;

public class CalendarTest extends BroadcastReceiver {
    @Override
    public void onReceive(Context context, Intent intent) {
        android.util.Log.i("CalendarTest", "CalendarTest.onReceive called!");
    }
}
with this manifest:

Code:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
      package="com.eshayne.android"
      android:versionCode="1"
      android:versionName="1.0">
    <uses-permission android:name="android.permission.READ_CALENDAR" />
    <application android:icon="@drawable/icon" android:label="@string/app_name" android:debuggable="true">
        <receiver android:name="com.eshayne.android.CalendarTest">
            <intent-filter>
                <action android:name="android.intent.action.EVENT_REMINDER" />
            </intent-filter>
        </receiver>
    </application>
    <uses-sdk android:minSdkVersion="8" />
</manifest>
Unfortunately, when I put this on my phone and set up a calendar event with a reminder - when the reminder alerts, I still see the AlertReceiver log entry, but not mine.

Any ideas what I may be missing?

Thanks,
Ethan
 
Thanks for the link - though as far as I can tell, that usage of EVENT_REMINDER_ACTION is for setting up the alarm, not for receiving it.

If this is any indication, though, of how the alarm is actually being set up (though I realize this example is a. specifically for rescheduling missed alarms, and b. not necessarily what any given phone manufacturer is using for their particular nonstandard Calendar application) - then I'm even more puzzled. According to Google's AlarmManager documentation (AlarmManager | Android Developers), when then alarm goes off it should simply broadcast an EVENT_REMINDER_ACTION intent, and it looks like any broadcast receiver should be able to receive it.
 
Back
Top Bottom