Reputation: 189
Any reason why onRequestPermissionsResult() won't be called?
Say in Activity A, I have requestPermission(Permission A, Permission A code). In Activity B, I have onRequestPermissionsResult which has an
if (requestCode == PermissionA.requestCode)
Shouldn't this work without any issues? Or am I doing something wrong.
I checked by putting debug logs and it calls requestPermission() and shows the disclosure UI (asking to accept and deny permission) but nothing happens after I press Accept, even though it should resume whatever I was trying to do.
Upvotes: 1
Views: 168
Reputation: 1007554
Shouldn't this work without any issues?
No. If you call requestPermissions()
for Activity A, that will trigger onRequestPermissionsResult()
in Activity A, not Activity B.
Upvotes: 2