hello anyone here using registerForActivityResult(...
# android
f
hello anyone here using registerForActivityResult() in a fragement while overriding onActivityResult in the host activity. My callback never gets called
😶 8
Copy code
val requestPermissionsLauncher: ActivityResultLauncher<Array<String>> =
    registerForActivityResult(
        ActivityResultContracts.RequestMultiplePermissions()
    ) { grantMap ->
        accessLocationRequested(!grantMap.containsValue(false) && grantMap.isNotEmpty())
    }
Copy code
requestPermissionsLauncher.launch(
    arrayOf(
        Manifest.permission.ACCESS_FINE_LOCATION,
        Manifest.permission.ACCESS_COARSE_LOCATION
    )
)
the onRequestPermissionsResult of the activity is called but not the callback in the fragment
I use appcompact 1.3-rc01
e
1. 😶 2. don't override onActivityResult 3. if you do, make sure to call super
f
Thanks but not helpful
🤣 3
😶 2
s
Maybe your fragment is detached? not sure how fragment manager behaves in this scenario
f
Thanks but I found the problem
👍 1
s
nice, what was it?
f
In our base fragment we used:
Copy code
override fun getLifecycle(): LifecycleRegistry