Permissionsdispatcher: Generated onRequestPermissionsResult method not called

Created on 4 Mar 2018  路  4Comments  路  Source: permissions-dispatcher/PermissionsDispatcher

override fun onRequestPermissionsResult(requestCode: Int, permissions: Array<String>, grantResults: IntArray) {
    super.onRequestPermissionsResult(requestCode, permissions, grantResults)
    // NOTE: delegate the permission handling to generated function
    onRequestPermissionsResult(requestCode, grantResults)
}

@NeedsPermission(Manifest.permission.CAMERA)
override fun showCamera() {
    cameraIntent()
}

@NeedsPermission(Manifest.permission.READ_EXTERNAL_STORAGE)
override fun showGallery() {
    galleryIntent()
}

@OnPermissionDenied(Manifest.permission.CAMERA)
override fun showDeniedForCamera() {
    permissionDialog("Camera permission is necessary",{ showCameraWithPermissionCheck() })
}

@OnPermissionDenied(Manifest.permission.READ_EXTERNAL_STORAGE)
override fun showDeniedForGallery() {
    permissionDialog("Gallery permission is necessary",{ showGalleryWithPermissionCheck() })
}

Overview

"Generated onRequestPermissionsResult method not called." error.

Expected

There is a lint error , but the file was generated and i dont know why the error appear..

Actual

Lint error with :
"Generated onRequestPermissionsResult method not called." error.
image

Environment

  • Which library version are you using? 3.1.0
  • On which devices do you observe the issue? The error on android studio
  • Note any other information that might be useful

Reproducible steps

bug contributionwelcome

All 4 comments

Does it happens only if you define multiple permission requests?

No, it happens for one permission either..

Got it. I don't think current lint support new kotlin feature.

Currently, we need XxxActivityPermissionsDispatcher. onRequestPermissionsResult call.
https://github.com/permissions-dispatcher/PermissionsDispatcher/blob/master/lint/src/main/java/permissions/dispatcher/CallOnRequestPermissionsResultDetector.java#L105-L108

Sorry for the late, we'll address in next ver.

Was this page helpful?
0 / 5 - 0 ratings