Android: 290019: A stackoverflow occurred on a 'WebView' page.

  • Updated

Reference Number: 1813

 

Summary: 

Applications that override android.webkit.WebView and modify the WebViewClient during the setWebViewClient method may experience a StackOverflowError. The StackOverflowError is caused by the application inadvertently taking ownership of the Thunderhead SDK WebViewClient.

 

Workaround:

To prevent the exception, the application must take care not to modify the Thunderhead WebViewClient when applied to custom WebViews managed by the application.

In the following example, an application developer has implemented the setWebViewClient, wrapping all WebViewClients. The conditional statement is necessary to exclude all WebViewClients the Thunderhead SDK may set from being managed by the application.

Here an application developer has implemented the setWebViewClient, excluding all Thunderhead SDK WebViewClients from being wrapped.

public void setWebViewClient(WebViewClient client) { 
if (client.getClass().getName().contains(“com.thunderhead”)) {
setClient(client);
} else {
wrapClient(client);
}
}

 

Status: Resolved.

Was this article helpful?

0 out of 0 found this helpful

Have more questions? Submit a request