I've received many emails asking how I had this issue solved. Actually this is only a small change to the content provider URI.
URI past Froyo: content://calendar/
URI after Froyo: content://com.android.calendar/
You'll need something like this on your code to handle older devices as well:
private static Uri CALENDAR_CALENDARS_URI = Uri.parse("content://calendar/calendars"); private static Uri CALENDAR_CALENDARS_URI_8_PLUS = Uri.parse("content://com.android.calendar/calendars"); private Uri getCalendarUri() { if(Integer.parseInt(Build.VERSION.SDK) <= 7) { return CALENDAR_CALENDARS_URI; } else { return CALENDAR_CALENDARS_URI_8_PLUS; } }
There is also Build.VERSION.SDK_INT avaiable since API level 4. But to make my application compatible with api level 3 I had to use Build.VERSION.SDK.
3 comments:
Useful for me. Thanks a lot.
Great post I would like to thank you for the efforts you have made in writing this interesting and knowledgeable article. TutuApp Android
This is highly informatics, crisp and clear. I think that everything has been described in systematic manner so that reader could get maximum information and learn many things. Cydia iOS 11.3
Post a Comment