Hey! Has anyone else encountered issues with Andro...
# compose
a
Hey! Has anyone else encountered issues with AndroidView and WebView? WebView is totally unresponsive.
Copy code
AndroidView(
    viewBlock = ::WebView,
    modifier = Modifier.fillMaxSize()
) { webView ->
    with(webView) {
        settings.javaScriptEnabled = true
        webViewClient = WebViewClient()
        loadUrl("<https://google.com>")
    }
}
This happens on API 24, but have encountered this issue also on API 29.
j
Please feel free to file a bug against Compose and link the bug in this thread.
👍🏻 1
a
j
Found this too: https://issuetracker.google.com/issues/174233728 Are the 2 bugs perhaps related?
a
This looks a bit different. In my case WebView doesn’t get rerendered on user input. It doesn’t impact other composables.
j
I was also planning to use a Webview in an AndroidView, are there any known workarounds?
a
If I knew that there is this Issues I would use Fragment for the screen which needs WebView and avoid hosting WebView inside AndroidView until this issue is fixed. But that actually means that you can’t use Jetpack Compose Navigation as well.
b
I filed a similar bug back in Dev14: https://issuetracker.google.com/issues/159838005
m
https://issuetracker.google.com/issues/177561480 was fixed and the fix will be available in the next releases
🎉 1
🙇🏻 1
For https://issuetracker.google.com/issues/174233728 please see the workaround I am suggesting