Fixed
Status Update
Comments
ri...@gmail.com <ri...@gmail.com> #2
Supplement:
class FooContract : ActivityResultContract<Unit, String?>() {
override fun createIntent(
context: Context,
input: Unit
): Intent = ...
...
}
il...@google.com <il...@google.com>
ap...@google.com <ap...@google.com> #3
Project: platform/frameworks/support
Branch: androidx-main
commit 00db97994d4eaa284059329776ce919aaea1183c
Author: Jeremy Woods <jbwoods@google.com>
Date: Mon Mar 29 12:14:25 2021
Fix NPE when using ActivityResultContract with non-null Unit input
When using a custom ActivityResultContract that has a non-null Unit
input, you can use the launch() extension methond that requires no
parameters. In this case, that call currently fail because we internal
call launch() with `null` instead of `Unit`.
RelNote: "Using the `launch()` method extension with a custom
`ActivityResultContract` that has a `Unit` input will no longer cause a
`NullPointerException`"
Test: ActivityResultLauncherTest
Bug: 183837954
Change-Id: I76282e17d47d25e3ff859f0b646e6063a381a510
A activity/activity-ktx/src/androidTest/java/androidx/activity/result/ActivityResultLauncherTest.kt
M activity/activity-ktx/src/main/java/androidx/activity/result/ActivityResultLauncher.kt
https://android-review.googlesource.com/1656172
Branch: androidx-main
commit 00db97994d4eaa284059329776ce919aaea1183c
Author: Jeremy Woods <jbwoods@google.com>
Date: Mon Mar 29 12:14:25 2021
Fix NPE when using ActivityResultContract with non-null Unit input
When using a custom ActivityResultContract that has a non-null Unit
input, you can use the launch() extension methond that requires no
parameters. In this case, that call currently fail because we internal
call launch() with `null` instead of `Unit`.
RelNote: "Using the `launch()` method extension with a custom
`ActivityResultContract` that has a `Unit` input will no longer cause a
`NullPointerException`"
Test: ActivityResultLauncherTest
Bug: 183837954
Change-Id: I76282e17d47d25e3ff859f0b646e6063a381a510
A activity/activity-ktx/src/androidTest/java/androidx/activity/result/ActivityResultLauncherTest.kt
M activity/activity-ktx/src/main/java/androidx/activity/result/ActivityResultLauncher.kt
jb...@google.com <jb...@google.com> #4
This has been fixed internally and will be available in the next Activity release.
Description
Component used: Activity-KTX Version used: 1.3.0-alpha05
Source of error:
Crash log:
It should be corrected to
launch(Unit, options)