Kotlin extensions for launch have been added to the androidx.activity.result package for ActivityResultLauncher and ActivityResultLauncher that remove the need to pass in null or Unit, respectively, mirroring that behavior from the previously invoke() extensions. (aosp/1304674, aosp/1304675)
launch(null)
passes null to non-null input parameter ofOtpContract
causingjava.lang.NullPointerException: Parameter specified as non-null is null
.To fix this we use kotlin extension for
launch
forActivityResultLauncher<Unit>
and don't need to pass any input parameter.See change-log for androidx.activity 1.2.0-alpha05