LeakCanary检测到webview内存泄漏

时间:2015-12-14 05:04:15

标签: android memory-leaks webview leakcanary

我在android应用程序中使用LeakCanary,问题如下: Check this Image

找到解决方案,替换:

的onCreate:

LinearLayout webViewHolderLayout = (LinearLayout)view.findViewById(R.id.webview_linearLayout);
newsView = new WebView(getActivity().getApplicationContext());
webViewHolderLayout.addView(newsView);

的onDestroy:

newsView.removeAllViews();
newsView.destroy();

问题仍然存在......

帮助!!!

1 个答案:

答案 0 :(得分:0)

似乎是在Marshmallow https://github.com/square/leakcanary/issues/92

中修复的webview错误