agustinroyo
Member
Hi. I have a problem with the activity recognition permission. Because it is necessary to use the application. But if the user manually deactivates it from application permissions, I cannot find a way to verify that it is inactive and request that it be activated.
I need something like
Starter.rp.CheckAndRequest(Starter.rp.PERMISSION_ACCESS_FINE_LOCATION)
Wait For Activity_PermissionResult (permission As String, Result1 As Boolean)
But it didn't exists for activity recognition permission (or maybe the android permission is called physical activity)
__________________________________
I found this JAVA code, but i don't know how to implement it to B4A
The app should check if the permission is granted already:
if (ContextCompat.checkSelfPermission(thisActivity, Manifest.permission.ACTIVITY_RECOGNITION)
!= PackageManager.PERMISSION_GRANTED) {
// Permission is not granted
}
To request the permission:
ActivityCompat.requestPermissions(thisActivity,
arrayOf(Manifest.permission.ACTIVITY_RECOGNITION),
MY_PERMISSIONS_REQUEST_ACTIVITY_RECOGNITION);
Thank you for your help!
I need something like
Starter.rp.CheckAndRequest(Starter.rp.PERMISSION_ACCESS_FINE_LOCATION)
Wait For Activity_PermissionResult (permission As String, Result1 As Boolean)
But it didn't exists for activity recognition permission (or maybe the android permission is called physical activity)
__________________________________
I found this JAVA code, but i don't know how to implement it to B4A
The app should check if the permission is granted already:
if (ContextCompat.checkSelfPermission(thisActivity, Manifest.permission.ACTIVITY_RECOGNITION)
!= PackageManager.PERMISSION_GRANTED) {
// Permission is not granted
}
To request the permission:
ActivityCompat.requestPermissions(thisActivity,
arrayOf(Manifest.permission.ACTIVITY_RECOGNITION),
MY_PERMISSIONS_REQUEST_ACTIVITY_RECOGNITION);
Thank you for your help!