Pero
Pero

Reputation: 794

Permission is not recognized by Android Studio

iam using Android Studio 2.1 and Android SDK 5. Android Studio is not recognizing the permission for CALL_PHONE. How to resolve this problem? In pictures you can see how i did it.

android manifest file

enter image description here

Upvotes: 0

Views: 1550

Answers (1)

Mansoor
Mansoor

Reputation: 1259

Your manifest file is fine. Problem is with user denying permission for Call after application is installed.

You need to check for permission at runtime as

if (ContextCompat.checkSelfPermission(thisActivity,Manifest.permission.CALL_PHONE)
    == PackageManager.PERMISSION_GRANTED) {
   // your code here
}

Upvotes: 2

Related Questions