I'm working on a Brownfield project and I need to interact with native contexts. The problem I'm experiencing is the failure to get activity navigation result using ActivityResultRegistry. Setting savedInstanceState to null in onCreate of the Activity Host prevents the result callback from working correctly.
private val launcher = registerForActivityResult(StartActivityForResult()) { result ->
...
}
Below, the workaround for avoid crash when restoring from background (#17), this prevent that other behaviors working in moment of restoring.
In my testing, i notice that onActivityResult is invoked, but this method is deprecated and changed for ActivityResultRegistry.
Base on this fact, does react-native-screens have any perspective of fixing this behavior for mitigate impact in projects that needs use ActivityResultRegistry?
Steps to reproduce
Turn on Don't Keep Activities on your device
Open the app
Click on Navigate to MainActivity 2
Result don't works when returning to the MainActivity
Description
I'm working on a Brownfield project and I need to interact with native contexts. The problem I'm experiencing is the failure to get activity navigation result using ActivityResultRegistry. Setting savedInstanceState to null in onCreate of the Activity Host prevents the result callback from working correctly.
Below, the workaround for avoid crash when restoring from background (#17), this prevent that other behaviors working in moment of restoring.
In my testing, i notice that
onActivityResult
is invoked, but this method is deprecated and changed for ActivityResultRegistry.Base on this fact, does
react-native-screens
have any perspective of fixing this behavior for mitigate impact in projects that needs use ActivityResultRegistry?Steps to reproduce
Don't Keep Activities
on your deviceNavigate to MainActivity 2
Result don't works when returning to the MainActivity
Snack or a link to a repository
https://github.com/jpcoliveira/ActivityRegistrySample
Screens version
3.31.1
React Native version
0.71.6
Platforms
Android
JavaScript runtime
V8
Workflow
None
Architecture
None
Build type
None
Device
Real device
Device model
No response
Acknowledgements
Yes