File tree Expand file tree Collapse file tree
AnkiDroid/src/main/java/com/ichi2/anki/workarounds Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -217,6 +217,27 @@ open class SafeWebViewLayout :
217217 }
218218}
219219
220+ /* *
221+ * It is called by [SafeWebViewLayout.onRenderProcessGone] after its internal [WebView] is replaced,
222+ * due to a render process crash or the system killing it to free memory.
223+ *
224+ * The host [Fragment] must always implement this interface. In debug builds a missing implementation
225+ * will throw at [SafeWebViewLayout.onAttachedToWindow]
226+ */
220227fun interface OnWebViewRecreatedListener {
228+ /* *
229+ * It is called by [SafeWebViewLayout.onRenderProcessGone] with the new [WebView] after
230+ * the old instance has been removed and destroyed. The implementations must reapply
231+ * all the clients,settings and content that were configured on the original [WebView]
232+ * because the previous configuration is not retained.
233+ *
234+ *`super.onWebviewRecreated(webview)` must be called when overriding this method in a subclass.
235+ *
236+ * To manually trigger this path,call `webviewLayout.loadUrl("chrome://crash")`.
237+ * Automated testing would require an instrumentation test, a unit test is not sufficient.
238+ *
239+ *
240+ * @param webView the new [webView],already attached to [SafeWebViewLayout]
241+ */
221242 fun onWebViewRecreated (webView : WebView )
222243}
You can’t perform that action at this time.
0 commit comments