Android calendar access
I am trying to access the users' calendar and the only tutorial I have found so far is this one which seems to be qu开发者_StackOverflow中文版ite old: http://jimblackler.net/blog/?p=151
Is there another tutorial I have missed ?
If I follow the tutorial, my program fails at this stage :
final Cursor cursor = contentResolver.query(Uri.parse("content://calendar/calendars"),
(new String[] { "_id", "displayName", "selected" }), null, null, null);
it says :
02-19 22:34:10.475: ERROR/ActivityThread(6588): Failed to find provider info for calendar
Can you guys help me .. I am not against reading documentation but I cannot find good one.
Swan
There is no calendar in the Android OS.
Some devices will have a calendar application. Some of those devices will have the Calendar application from the AOSP. Other devices will have their own calendar. The code you show is neither documented nor supported for the Calendar application, will not work on all versions of Android, and may not work on some devices.
If you wish to update the user's Google Calendar, there is a GData API for it.
I'm also working on something that needs to access all calendars, not just the Google calendar. You might want to try content://com.android.calendar instead of content://calendar, but that may not work on anything less than 2.2. Also, I found this link helpful for this problem, http://android-codes-examples.blogspot.com/2011/02/insertion-and-deletion-of-calendar.html
But there are applications that can read and write the calendar such as appbrain.com/app/calwidget/net.eggenstein.android.calwidget So I guess it is possible! I just want to read the calendar, there is an authorisation for reading the calendar, I would expect its not a useless option ...
Please follow the link to ovoid error " Failed to find provider info for calendar "
精彩评论