Remove Android WebView from view system before calling destroy()
See original GitHub issueBug description:
React-native needs to remove WebView from the view hierarchy before calling .destroy()
. From this comment it seems react-native is not doing so:
... W/cr_AwContents: WebView.destroy() called while WebView is still attached to window. ...
This probably isn’t causing a crash (WebView tries to handle this case gracefully), but older versions of WebView may not handle this as gracefully (I’ve observed crashes on really old Android versions).
To Reproduce:
Not sure. This log message probably repros every time you trigger the cleanup code path.
Expected behavior:
The documentation states:
This method should be called after this WebView has been removed from the view system. No other methods may be called on this WebView after destroy.
https://developer.android.com/reference/android/webkit/WebView.html#destroy()
Screenshots/Videos:
N/A
Environment:
- OS: Android
- OS version: probably all
- react-native version:
- react-native-webview version:
Issue Analytics
- State:
- Created 4 years ago
- Reactions:1
- Comments:7
Top GitHub Comments
when using react navigation, we can hide WebView in event listener
it worked here!!! thank you ❤️