I\'m trying to make my app ready for Android 6 and now I\'m stuck to the point where you need to request and check permissions.
I tried the following from the docs:
Here is how you need to call in various scenarios,
In case of activity:
ContextCompat.checkSelfPermission(MyActivity.this,
Manifest.permission.WRITE_CALENDAR);
In case of fragment:
ContextCompat.checkSelfPermission(getActivity(),
Manifest.permission.WRITE_CALENDAR);
In case of any utility class use context:
ContextCompat.checkSelfPermission(context,
Manifest.permission.WRITE_CALENDAR);
Comment below for further information