Fixed
Status Update
Comments
il...@google.com <il...@google.com> #2
This looks like it needs the same type of fix+test as was done in by rememberUpdatedState(onResult)
ap...@google.com <ap...@google.com> #3
Project: platform/frameworks/support
Branch: androidx-main
commit 36c05b83a66243d134c39603fa135290cfc139b6
Author: Jeremy Woods <jbwoods@google.com>
Date: Tue Mar 02 16:26:41 2021
Keep any active launchers in the ActivityResultRegistry
After an ActivityResultLauncher has launched an Activity, it is
currently possible for the launching Activity to be destroyed, which
would result in any activity results being lost.
Instead of allowing there active launcher to be dropped, we should
maintain them, ensuring that if an ActivityResult is launched, it always
gets a result.
RelNote: "ActivityResultLaunchers that have launched, will now always
return their results."
Test: ActivityResultRegistryTest
Bug: 181267562
Change-Id: I9ef34256a1e0f93fd1fd8983e867b9dd5e8e2441
M activity/activity/src/androidTest/java/androidx/activity/result/ActivityResultRegistryTest.kt
M activity/activity/src/main/java/androidx/activity/result/ActivityResultRegistry.java
https://android-review.googlesource.com/1613304
Branch: androidx-main
commit 36c05b83a66243d134c39603fa135290cfc139b6
Author: Jeremy Woods <jbwoods@google.com>
Date: Tue Mar 02 16:26:41 2021
Keep any active launchers in the ActivityResultRegistry
After an ActivityResultLauncher has launched an Activity, it is
currently possible for the launching Activity to be destroyed, which
would result in any activity results being lost.
Instead of allowing there active launcher to be dropped, we should
maintain them, ensuring that if an ActivityResult is launched, it always
gets a result.
RelNote: "ActivityResultLaunchers that have launched, will now always
return their results."
Test: ActivityResultRegistryTest
Bug: 181267562
Change-Id: I9ef34256a1e0f93fd1fd8983e867b9dd5e8e2441
M activity/activity/src/androidTest/java/androidx/activity/result/ActivityResultRegistryTest.kt
M activity/activity/src/main/java/androidx/activity/result/ActivityResultRegistry.java
jb...@google.com <jb...@google.com> #4
This has been fixed internally and will be released as part of the Activity versions 1.2.1
and 1.3.0-alpha04
.
ap...@google.com <ap...@google.com> #5
Project: platform/frameworks/support
Branch: androidx-main
commit 753197d81d6db3ab3cdd5138beb01b4634639670
Author: Jeremy Woods <jbwoods@google.com>
Date: Tue Mar 02 17:21:04 2021
Add compose activity result test for unregistered result
Adding a test to ensure that if a launched registry is disposed, the
result is still always delivered.
Test: ActivityResultRegistryTest
Bug: 181267562
Change-Id: Idc7ca9e1955d398807d3f7c78518a71d3423fc12
M activity/activity-compose/src/androidTest/java/androidx/activity/compose/ActivityResultRegistryTest.kt
https://android-review.googlesource.com/1613861
Branch: androidx-main
commit 753197d81d6db3ab3cdd5138beb01b4634639670
Author: Jeremy Woods <jbwoods@google.com>
Date: Tue Mar 02 17:21:04 2021
Add compose activity result test for unregistered result
Adding a test to ensure that if a launched registry is disposed, the
result is still always delivered.
Test: ActivityResultRegistryTest
Bug: 181267562
Change-Id: Idc7ca9e1955d398807d3f7c78518a71d3423fc12
M activity/activity-compose/src/androidTest/java/androidx/activity/compose/ActivityResultRegistryTest.kt
Description
Version used: JetPack Compose beta:1.0.0
An issue with registerforActivityResult for jetpack compose
I have a composable function that is used to get the List<Uri> for files. On the button click the file explorer launches and I'm able to select files. But when I try this for the first time. The ActivityResultContracts.OpenMultipleDocuments() returns a blank list and on the second try, it actually works and returns the List<URI> for the files selected.
If this is a bug in the library, we would appreciate it if you could attach:
Attached is the sample project link from Github -