Skip to content

No device calendar found on Android device #2871

@KlausHeywinkel

Description

@KlausHeywinkel

In my app I use the CN1 Calendar lib to access the device calendar. I added the Android-build-hints so that my app is allowed to access the calendar (I can proof this in the App-Settings). But the method deviceCalender.getCalendars() returns null - which is documented with "no permissions". What can I do to access the calendar on an Android device? (btw: It works fine on iOS).

Test-Device: HUAWEI P-Smart with Android 8.0.0.138

This is the code I used:

if (deviceCalender.hasPermissions())
{
    Collection<String> cals = deviceCalender.getCalendars();

    if( cals != null )
    {
        System.out.println("Length of Calendar-List: " + cals.size());
    }
    else
    {
        System.out.println("No permission on getCalendars()");
    }
}
else
    System.out.println("No permission on hasPermissions()");

In Android-Studio I only get this console-output:

2019-07-25 11:30:35.185 25342-25375/de.zeitkuenstlervoll.gtd.gui I/System.out: No permission on getCalendars()

See also this question on stackexchange

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions