错误:WebView.destroy()呼吁,同时还附 [英] Error: WebView.destroy() called while still attached

查看:203
本文介绍了错误:WebView.destroy()呼吁,同时还附的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我收到此错误时,该设备改变方向:

I am getting this error when the device changes orientation:

错误:WebView.destroy()调用时仍附着<​​/ code>

Error: WebView.destroy() called while still attached

通过这个code:

protected void onDestroy()
{
    if (adView != null)
    {
        adView.destroy();
    }
}

,这是什么原因呢?如何避免这个问题?

What is the reason for this? How do I avoid this error?

推荐答案

您首先需要分离web视图:

You first need to detach the Webview:

webViewPlaceholder.removeView(myWebView);
myWebView.removeAllViews();
myWebView.destroy();

这是为我做。

这篇关于错误:WebView.destroy()呼吁,同时还附的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆