K Kiran Raotole Active Member Licensed User Sep 3, 2018 #1 I'm getting error of READ_PHONE_STATE permission. Error : java.lang.SecurityException: getDeviceId: Neither user 10200 nor current process has android.permission.READ_PHONE_STATE. code: B4X: Dim rp As RuntimePermissions rp.CheckAndRequest(rp.PERMISSION_READ_PHONE_STATE) Dim pid As PhoneId Log(pid.GetDeviceId) manifest: B4X: AddPermission(android.permission.READ_PHONE_STATE)
I'm getting error of READ_PHONE_STATE permission. Error : java.lang.SecurityException: getDeviceId: Neither user 10200 nor current process has android.permission.READ_PHONE_STATE. code: B4X: Dim rp As RuntimePermissions rp.CheckAndRequest(rp.PERMISSION_READ_PHONE_STATE) Dim pid As PhoneId Log(pid.GetDeviceId) manifest: B4X: AddPermission(android.permission.READ_PHONE_STATE)
DonManfred Expert Licensed User Longtime User Sep 3, 2018 #2 What is the result of the Requestpermission (check result sub and if the permission is granted by the user)? Kiran Raotole said: Dim pid As PhoneId Log(pid.GetDeviceId) Click to expand... Only call this if the permission is granted. android.jar / targetSdkVersion / minSdkVersion Especially RuntimePermissions Upvote 0
What is the result of the Requestpermission (check result sub and if the permission is granted by the user)? Kiran Raotole said: Dim pid As PhoneId Log(pid.GetDeviceId) Click to expand... Only call this if the permission is granted. android.jar / targetSdkVersion / minSdkVersion Especially RuntimePermissions
Erel B4X founder Staff member Licensed User Longtime User Sep 3, 2018 #3 The code is incorrect. Watch the runtime permissions video tutorial. Upvote 0
K Kiran Raotole Active Member Licensed User Sep 3, 2018 #4 yeah may be I missing this B4X: Wait For Activity_PermissionResult (Permission As String,Result As Boolean) Upvote 0
yeah may be I missing this B4X: Wait For Activity_PermissionResult (Permission As String,Result As Boolean)