Yubico / yubikit-android

Yubico Mobile Android SDK - YubiKit
Apache License 2.0
114 stars 42 forks source link

[AndroidDemo] use ActivityResultLauncher<Unit>.launch extension #70

Closed AdamVe closed 2 years ago

AdamVe commented 2 years ago

launch(null) passes null to non-null input parameter of OtpContract causing java.lang.NullPointerException: Parameter specified as non-null is null.

To fix this we use kotlin extension for launch for ActivityResultLauncher<Unit> and don't need to pass any input parameter.

See change-log for androidx.activity 1.2.0-alpha05

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)