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
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'