I am working with the Kotlin language in android studio. I am requesting permission to access the gallery and I am writing this when I use the "if-else" structure to query the permission and there is a dash above the requestPermissions statement. how do we solve this.
activity?.let {
if (ContextCompat.checkSelfPermission(requireActivity().applicationContext,Manifest.permission.READ_EXTERNAL_STORAGE)!= PackageManager.PERMISSION_GRANTED) {
requestPermissions(arrayOf(Manifest.permission.READ_EXTERNAL_STORAGE), 1)