问题
I am trying to access the android device calendar, which fails with this exception
I added this exact build hint to the codenameone_settings.properties file:
codename1.arg.android.xpermissions=<uses-permission android:name="android.permission.READ_CALENDAR"/> <uses-permission android:name="android.permission.WRITE_CALENDAR"/>
Is there something I am missing?
回答1:
This is caused by the new Android security permission in API level 23.
You can set your app to use API level 21 by adding the build hint below and DeviceCalendar
should work.
android.targetSDKVersion=21
Remember to always Upvote, Mark as answer, or leave a comment when another user answers your question. That's the only reward they get for helping you to solve a problem.
回答2:
please refer this link hope it will help you https://groups.google.com/forum/#!topic/codenameone-discussions/YMP7W4_9mjM
Use Native code to set the permission.
来源:https://stackoverflow.com/questions/43089357/android-calendar-permission-issue