Frage

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?

War es hilfreich?

Lösung

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

Andere Tipps

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

/ bludger,

strange bug. You should just remove this line of code

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

and it should work perfectly as "Single Event". If you use the rrule option, you tell the app to "repeat" the event.

So... just remove that line of code and it should work.

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top