Hi, We have created a native Kotlin Bridge to comm...
# compose
b
Hi, We have created a native Kotlin Bridge to communicate with Webview. Calling a Native Kotlin function from a Button click on Webview works well via Javascript Interface like calling a showToast() (Non-Composable) function. However calling a Composable function from Button click on Webview doesn’t work - Like calling AlertComponentDialog() (Composable Function). Any Idea how to call a Composable function from Android Webview?
s
Well in the first case you’re calling for an event of showing the toast, while in the compose case you’re not. How about you change the second case to also act like “triggering the show dialog event” aka flip a boolean like
var showAlert by remember(Saveable) { mutableStateOf(false) }
and then show the
AlertComponentDialog
like:
Copy code
if (showAlert) {
    AlertComponentDialog()
}
👍 1
b
Ok, thanks, let me try