ChoosePhotoHelper develops a component which facilitates the source code of picking photos in your Android apps.
57
stars
26
forks
source link
Crash if one permission granted and then grant second permission when try to launch camera #19
Closed
Podox2 closed 3 years ago
There is next code in onRequestPermissionsResult() for camera:
if ((grantResults.isNotEmpty() && grantResults[0] == PackageManager.PERMISSION_GRANTED && grantResults[1] == PackageManager.PERMISSION_GRANTED)) { onPermissionsGranted(requestCode) }
But in grantResults[] will be only one object and java.lang.ArrayIndexOutOfBoundsException: length=1; index=1 will be thrown.
Simple fix is check is grantResults[] has only one object.