Fixed
Status Update
Comments
il...@google.com <il...@google.com> #2
As per the
The
setFragmentResult()
andsetFragmentResultListener()
APIs now take a non-nullBundle
andFragmentResultListener
, respectively. To explicitly clear a previously set result or listener, use the newclearFragmentResult()
andclearFragmentResultListener()
methods. () b/155416778
We'll update the Javadoc to call this out.
You can create whatever contract you want between your result setter and listener, be it an empty Bundle, an Enum value, your own custom Parcelable, whatever.
ap...@google.com <ap...@google.com> #3
Project: platform/frameworks/support
Branch: androidx-main
commit 6dc219c28bb2c64f5a517b64f3592c85d7bf5127
Author: Jeremy Woods <jbwoods@google.com>
Date: Wed Mar 03 10:57:00 2021
Fix fragment-ktx kdocs
Since Fragment `1.3.0-alpha05` to clear a FragmentResult or
FragmentResultListener, you should use the respective "clear" methods.
The documentation for the parameters of set methods should be updated
since they no longer use null to clear.
RelNote: "The Kdocs for setFragmentResult and setFragmentResultListener
have updated their parameters docs to reflect that they no longer accept
nullables"
Test: ./gradlew bOS
Bug: 178348386
Change-Id: I990baa2e1b71a11b11342c366c284903c247e631
M fragment/fragment-ktx/src/main/java/androidx/fragment/app/Fragment.kt
https://android-review.googlesource.com/1615442
Branch: androidx-main
commit 6dc219c28bb2c64f5a517b64f3592c85d7bf5127
Author: Jeremy Woods <jbwoods@google.com>
Date: Wed Mar 03 10:57:00 2021
Fix fragment-ktx kdocs
Since Fragment `1.3.0-alpha05` to clear a FragmentResult or
FragmentResultListener, you should use the respective "clear" methods.
The documentation for the parameters of set methods should be updated
since they no longer use null to clear.
RelNote: "The Kdocs for setFragmentResult and setFragmentResultListener
have updated their parameters docs to reflect that they no longer accept
nullables"
Test: ./gradlew bOS
Bug: 178348386
Change-Id: I990baa2e1b71a11b11342c366c284903c247e631
M fragment/fragment-ktx/src/main/java/androidx/fragment/app/Fragment.kt
jb...@google.com <jb...@google.com> #4
This has been fixed internally and will be available in the Fragment 1.3.1
and 1.4.0-alpha01
releases.
Description
1.3.0-rc01
The documentation of
Fragment.setFragmentResult
extension function offragment-ktx
is wrong about nullability ofresult
.@param result the result to be passed to another fragment or
nullif you want to clear out any pending result.
result
is annotated@NonNull
onFragmentManager
Java API and the Kotlin type ofresult
isBundle
, notBundle?
.How can we "clear out any pending result" then?
Related to this, how should we communicate "cancel" or "no result" with this API? An empty bundle?