I'm making app with Google Map but i have a problem with permissions. Someone can help me please? While Android 10 has no problem, Android 9 has this problem. These 106-115 row's codes
if (ContextCompat.checkSelfPermission(this,android.Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED){
requestPermissions(arrayOf(android.Manifest.permission.ACCESS_FINE_LOCATION),1)
}else{
locationManager!!.requestLocationUpdates(LocationManager.GPS_PROVIDER,2,2f,locationListener)
mMap.clear()
var lastLocation = locationManager!!.getLastKnownLocation(LocationManager.GPS_PROVIDER)
var lastUserLocation = LatLng(lastLocation!!.latitude,lastLocation!!.longitude)
mMap.moveCamera(CameraUpdateFactory.newLatLngZoom(lastUserLocation,17f))
}