Fixed
Status Update
Comments
ap...@google.com <ap...@google.com> #2
Please provide a minimal sample project that reproduces this issue.
jb...@google.com <jb...@google.com> #3
Sure, I created a minimal sample app for you:
Just click "Next Fragment" multiple times, then press the back button or perform the back gesture multiple times in quick succession.
Note: I tested this on a Pixel 8 with Android 14. Also, I have the predictive back animations enabled in the developer options.
Description
When using the ActivityResultAPIs with fragment, the latest possible time that
registerForActivityResult()
should be called is inonCreate()
. Any calls made toregisterForActivityResult()
made afteronCreate()
will be ignored.Instead of ignoring these calls and allowing developers to assume that their callback is registered, we should throw an exception notifying that they are attempting to register too late.