3

I have added an event to calender app in android mobile by using below code. But its failed to set reminder by default in some devices(samsung tab 3). In google nexus, reminder set for 10 minutes by default when i used below code snippet. How to set reminder via intent by setting some flag to intent..

Calendar beginTime = Calendar.getInstance();
beginTime.set(2014, 2, 18, 13, 4);
Calendar endTime = Calendar.getInstance();
endTime.set(2012, 0, 19, 8, 30);
Intent intent = new Intent(Intent.ACTION_INSERT)
.setData(Events.CONTENT_URI)
.putExtra(CalendarContract.EXTRA_EVENT_BEGIN_TIME, beginTime.getTimeInMillis())
.putExtra(CalendarContract.EXTRA_EVENT_END_TIME, endTime.getTimeInMillis())
.putExtra(Events.TITLE, "Yoga")
.putExtra(Events.DESCRIPTION, "Group class")
.putExtra(Events.EVENT_LOCATION, "The gym")
.putExtra(Events.AVAILABILITY, Events.AVAILABILITY_BUSY)
.putExtra(Intent.EXTRA_EMAIL, "rowan@example.com,trevor@example.com");
startActivity(intent);
dev1993
  • 231
  • 3
  • 17
  • Maybe the devices have different time formatting for the class calender. Try to use GregorianCalendar for example, maybe that will do the trick. – Alex Jan 29 '17 at 00:35

0 Answers0