CopyPastor

Detecting plagiarism made easy.

Score: 0.8345855975360201; Reported for: String similarity Open both answers

Possible Plagiarism

Plagiarized on 2019-01-21
by Prateek Aggarwal

Original Post

Original - Posted on 2015-12-12
by Manikanta



            
Present in both answers; Present only in the new answer; Present only in the old answer;

Here is how you need to call in various scenarios,
In case of activity:

ContextCompat.checkSelfPermission(MyActivity.this, Manifest.permission.READ_CONTACTS);
In case of fragment:

ContextCompat.checkSelfPermission(getActivity(), Manifest.permission.READ_CONTACTS);
In case of any utility class use context:

ContextCompat.checkSelfPermission(context, Manifest.permission.READ_CONTACTS);
for more depth, you can refer to https://developer.android.com/training/permissions/requesting
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


        
Present in both answers; Present only in the new answer; Present only in the old answer;