1

It works perfect when adding an event, I can add all the data of the event but with the reminder it doesn't work, what should I change?.

This is my code

            Intent intent = new Intent(Intent.ACTION_INSERT);
            intent.setType("vnd.android.cursor.item/event");

            String id="123";

            GregorianCalendar fechaSeleccionada = new GregorianCalendar(year, month, dayOfMonth);

            intent.putExtra(CalendarContract.EXTRA_EVENT_BEGIN_TIME,
                    fechaSeleccionada.getTimeInMillis());

            intent.putExtra(CalendarContract.EXTRA_EVENT_END_TIME,
                    fechaSeleccionada.getTimeInMillis());
            intent.putExtra(CalendarContract.EXTRA_EVENT_ALL_DAY, true);

            intent.putExtra(CalendarContract.EXTRA_EVENT_ID, id);

            //This is Information about Calender Event.
            intent.putExtra(CalendarContract.Events.TITLE, "Siddharth Birthday");
            intent.putExtra(CalendarContract.Events.DESCRIPTION, "This is a description");
            intent.putExtra(CalendarContract.Events.EVENT_LOCATION, "My Guest House");
            intent.putExtra(CalendarContract.Events.RRULE, "FREQ=YEARLY");

            //This is Information about Reminders.
            intent.putExtra(CalendarContract.Reminders.EVENT_ID, id);
            intent.putExtra(CalendarContract.Reminders.MINUTES, 60);
            intent.putExtra(CalendarContract.Reminders.METHOD, CalendarContract.Reminders.METHOD_ALERT);

            startActivity(intent);
Gift You
  • 21
  • 2

0 Answers0