Dominic Dominic - 1 year ago 129
Android Question

Can not resolve this CALL_PRIVILEGED permission

Sry but I am an idiot. I forgot to make this import:

import android.Manifest

I just want to check if the user has given the permission for making phone calls.

if (ContextCompat.checkSelfPermission(this,
Manifest.permission.CALL_PHONE) != PackageManager.PERMISSION_GRANTED){

Android Studio says that it can not resolve this

This is my AndroidManifest file:

<uses-permission android:name="android.permission.CALL_PHONE" />

Can anybody help me?


My main problem is that I can`t read any permission at all.

Answer Source

To be able to use Manifest.permission constants, you need to import android.Manifest, as Manifest is a Java class.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download