, but we cannot do this in Compose due to the application being in the wrong state
RESUMED
instead of
STARTED
java.lang.IllegalStateException: LifecycleOwner com.app.main.MainActivity@f90bdab is attempting to register while the current state is RESUMED. LifecycleOwners must call register before they are STARTED.
If an external SDK is directly calling the deprecated
startActivityForResult
, the only way to get the result from that is from
onActivityResult
up at the activity (or fragment, depending on how the SDK works) layer. The Activity Result APIs will only send you a response if you
launch
them - they cannot intercept other activity result requests. You should ask that SDK to provide an Activity Result Contract, which would ensure it could be used in an activity, fragment, or composable