Android Question B4A Calendar2 broken in Lollipop?

Derek Johnson

Active Member
Licensed User
I've just installed a previously working app using the calendar2 (version: 1.12) library onto a Nexus 7 (2012) tablet with Lollipop. I changed the manifest to include

SetApplicationAttribute(android:theme, "@android:style/Theme.Holo")

as recommended.

Unfortunately when I used the call below to get a list of Calendar events, none were returned.

        Dim StartDate As String, EndDate As String
        DateTime.DateFormat="dd MMM yyyy"
        Log("Start date is " & DateTime.Date(StartDate))
        'Make sure time starts at Midnight
        DateTime.DateFormat="dd MMM yyyy"
        Log("End date is " & DateTime.Date(EndDate))
        mycalendarlist = cal.GetListofEventsforCalendarBetweenDates(CalendarNumber,StartDate,EndDate)
        Log("Number of events in Calendar " & mycalendarlist.Size)

This is from the log:

Start date is 04 Dec 2014
End date is 07 Dec 2014
Number of events in Calendar 0

Is this a known issue - am I doing something wrong?

The previous code correctly locates 3 potential calandars.

Derek Johnson

Active Member
Licensed User
I have now found what the problem was. When I was searching for the calendar ID with

myMap = cal.GetListOfAllCalendars(False)        'get a "Map" of the available calendars

it returned a calendar ID which had read only access as well as one that did have owner access. ( I have multiple Gmail accounts registered on this device). I used the first ID that I encountered that matched the required calendar name and this one did have sufficient permission (apparently) to get the list of events.

I have since modified the search to myMap = cal.GetListOfAllCalendars(True) which returns an ID which does have permission to get the event list.

I'm a bit puzzled though why you would need more than read-only access to get the list of events.
Upvote 0