Dominic Dominic - 2 months ago 14
Android Question

Can not resolve this CALL_PRIVILEGED permission

SOLVED:
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
CALL_PHONE
symbol.

This is my AndroidManifest file:

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


Can anybody help me?

EDIT:

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

Answer

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

Comments