79665001

Date: 2025-06-13 14:35:10
Score: 0.5
Natty:
Report link

Try ensuring the .launch() call is distant from the registration call (at least not in the same (re)compose).

I suspect the Photo Picker behaves like other Activities, and thus this note from docs on getting results from activities would apply (emphasis mine):

Note: You must call registerForActivityResult() before the fragment or activity is created, but you can't launch the ActivityResultLauncher until the fragment or activity's Lifecycle has reached CREATED.

To me, this implies registerForActivityResult must be called early enough for the Lifecycle of the underlying Photo Picker activity to reach CREATED, though I'm unsure how to test that theory.

I only started Android dev today so 0 experience and YMMV, but this resolved the same issue for me.

Reasons:
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Unregistered user (0.5):
  • Low reputation (1):
Posted by: combobulator