Skip to content Skip to sidebar Skip to footer

When Calendar Has Fired Receiver For Reminder Alerts In Android, How Can I Get The Event Id?

Here is my code: public class CalendarReminderReceiver extends BroadcastReceiver{ @Override public void onReceive(Context context, Intent intent) { if (intent.getAction().equa

Solution 1:

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);

}

Post a Comment for "When Calendar Has Fired Receiver For Reminder Alerts In Android, How Can I Get The Event Id?"