chansek
@Composable fun Payment( price: Double, onResult: (Int, PaymentResponse) -> Unit ) { val launcher = rememberLauncherForActivityResult(ActivityResultContracts.StartActivityForResult()) { onResult(RC_PAY, appNotFoundError ?: handlePaymentResult(it.data)) } launcher.launch(preparePaymentIntent(price)) }
launcher.launch
Intent
launch
Filip Wiesner
try { ... } catch(e: ActivityNotFoundException) { ... }
rememberLauncherForActivityResult
resultCode
A modern programming language that makes developers happier.