android calendar permission issue

倖福魔咒の 提交于 2019-12-07 20:16:56

问题


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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!