Getting a calendar events instances

2019-05-24 04:24发布

问题:

I am trying to get an events other reoccurring instances and I thought the uri was content://com.android.calendar/instances but everytime i do that I get a databaseutil error saying it does not exist.

so how do I get events instances so I can find out the next time an event is set for?

回答1:

The current URI's are

  • instances/when/*/* - All instances between two times (timestamp in milliseconds)
  • instances/whenbyday/*/* - All instances between two times (timestamp in Julian days - see set/getJulianDay() in Time)
  • instances/groupbyday/*/* - Same, but grouped by day.

See my answer to another question for more information: Cannot read recurring events from android calendar programmatically



回答2:

The calendar provider is not part of the SDK, so the URI can and will change (and might not even be consistent across devices). Your best bet is to use the Java Client API.