Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/200.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Android LeakCanary检测到webview内存泄漏_Android_Memory Leaks_Webview_Leakcanary - Fatal编程技术网

Android LeakCanary检测到webview内存泄漏

Android LeakCanary检测到webview内存泄漏,android,memory-leaks,webview,leakcanary,Android,Memory Leaks,Webview,Leakcanary,我在android应用程序中使用了LeakCanary,问题如下: 找到解决方案,替换: onCreate: LinearLayout webViewHolderLayout = (LinearLayout)view.findViewById(R.id.webview_linearLayout); newsView = new WebView(getActivity().getApplicationContext()); webViewHolderLayout.addView(newsView

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

找到解决方案,替换:

onCreate:

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

LinearLayout webViewHolderLayout = (LinearLayout)view.findViewById(R.id.webview_linearLayout);
newsView = new WebView(getActivity().getApplicationContext());
webViewHolderLayout.addView(newsView);
newsView.removeAllViews();
newsView.destroy();
问题仍然存在


帮助!!!

看起来像是webview的bug,在棉花糖中修复