Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Setting frequency attribute RRULE to run the event once

I have

Intent intent = new Intent(Intent.ACTION_EDIT);
intent.setType("vnd.android.cursor.item/event");
intent.putExtra("beginTime", dateStart.getTime());
intent.putExtra("allDay", false);
intent.putExtra("rrule", "FREQ=DAILY");
intent.putExtra("endTime", dateEnd.getTime());
startActivity(intent);

To compile an event and I want to run the event one time.

The line that set the frequency is

intent.putExtra("rrule", "FREQ=DAILY");

also if I delete this line, by default the android calendar is set to DAILY if I don't change it manually.

I have looking for a list off all supported attributes and I have found MONTLY,YEARLY etc. but I can't find the right supported syntax for "one time"

Could you help me?

like image 834
AndreaF Avatar asked Dec 26 '22 21:12

AndreaF


2 Answers

The proper way to set a one time only event, according to the spec linked to in the documentation, is not to specify RRULE. Are you certain the event recurs, rather than just displaying the frequency as daily and still only firing once? If so, the following should work, though it's a bit of a hack:

intent.putExtra("rrule", "FREQ=DAILY;COUNT=1");
like image 91
Esoteric Screen Name Avatar answered Jan 11 '23 12:01

Esoteric Screen Name


For one time event, you can also just not set anything.

like image 37
NPC Avatar answered Jan 11 '23 13:01

NPC