override fun onRequestPermissionsResult(
requestCode: Int,
permissions: Array<out String>,
grantResults: IntArray
) {
// super.onRequestPermissionsResult(requestCode, permissions, grantResults)
Log.wtf("here grand result" , requestCode.toString(),)
Log.wtf("here grand result" , grantResults.toString(),)
if(requestCode == PERMISSION_REQUEST_ACCESS_LOCATION){
if(grantResults.isNotEmpty() && grantResults[0] == PackageManager.PERMISSION_GRANTED){
Toast.makeText(requireActivity(),"permission granted",Toast.LENGTH_SHORT).show()
getUserLocation()
}else{
Toast.makeText(requireActivity(),"Denied",Toast.LENGTH_SHORT).show()
}
}
}
I am always get the auto toast message from here but when location granted then i wants to call a function but this override method not working inside fragment please help me ? Thanks in advance