开发者

i want to get calendar event detail which is update or change by user in android device

开发者 https://www.devze.com 2023-03-03 22:13 出处:网络
Here we consider that we are adding or deleting the calendar events from code. How to know if the event updates(adding/editing/deleting calendar events) done by 开发者_开发知识库the user on his/her de

Here we consider that we are adding or deleting the calendar events from code. How to know if the event updates(adding/editing/deleting calendar events) done by 开发者_开发知识库the user on his/her device ?


Not sure it is entirely possible to monitor changes to the Calendar, but you could try:

String[] projection = new String[] { "_id" };
Uri calendars = Uri.parse("content://calendar/calendars");

Cursor managedCursor = managedQuery(calendars, projection, null, null, null);

and then use registerContentObserver (see http://developer.android.com/reference/android/database/Cursor.html#registerContentObserver%28android.database.ContentObserver%29) to monitor the Cursor for changes.

Let me know if that works.

0

精彩评论

暂无评论...
验证码 换一张
取 消