When calendar has fired receiver for reminder alerts in Android, how can I get the event id?

android

Solution

Maybe too late, but here is my solution:

if (intent.getAction().equalsIgnoreCase(CalendarContract.ACTION_EVENT_REMINDER)) {
    //Do Something Here to get EVENT ID
    Uri uri = intent.getData();

    String alertTime = uri.getLastPathSegment();

    String selection = CalendarContract.CalendarAlerts.ALARM_TIME + "=?";

    Cursor cursor = context.getContentResolver().query(CalendarContract.CalendarAlerts.CONTENT_URI_BY_INSTANCE, new String[]{CalendarContract.CalendarAlerts.EVENT_ID},selection,new String[]{alertTime}, null);

}

Problem

Here is my code: ``` public class CalendarReminderReceiver extends BroadcastReceiver{ @Override public void onReceive(Context context, Intent intent) { if (intent.getAction().equalsIgnoreCase(CalendarContract.ACTION_EVENT_REMINDER)) { //Do Something Here to get EVENT ID } } } ``` Is there anyway to get the event id from the broadcast receiver for reminder events? Here is my manifest: ``` <receiver android:name="com.calendar.CalendarReminderReceiver"> <intent-filter> <action android:name="android.intent.action.EVENT_REMINDER" /> <data android:scheme="content"/> </intent-filter> </receiver> ```

Original source

Related problems