How to add multiple event to android marshmallow Calendar?

后端 未结 1 1869
无人及你
无人及你 2021-01-26 18:47

Events are adding to calendar properly till api 22.

I have also implemented run- time permissions for Marshmallow , Calender permission is allowed in Phone setting for

相关标签:
1条回答
  • 2021-01-26 19:25

    May be you want to use inside Fragment .

    at first use :

    super.requestPermissions( new String[]{Manifest.permission.WRITE_CALENDAR}, MY_PERMISSIONS_REQUEST_WRITE_CALENDAR);
    

    Inside fragment, you need to call:

    FragmentCompat.requestPermissions(permissionsList, RequestCode)
    

    Note:

    ActivityCompat.requestPermissions(Activity, permissionsList, RequestCode);
    

    add this library for FragmentCompat class in app.gradle.

    compile 'com.android.support:support-v13:version_of_library'
    
    0 讨论(0)
提交回复
热议问题