Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/197.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 WebView在24小时后打开时需要花费大量时间加载_Android_Webview - Fatal编程技术网

Android WebView在24小时后打开时需要花费大量时间加载

Android WebView在24小时后打开时需要花费大量时间加载,android,webview,Android,Webview,我使用Android web view在我的应用程序中加载网页,当我在长时间(约24小时)后打开应用程序时,完全加载数据需要40-50秒,但当我关闭应用程序并再次打开应用程序时,加载数据需要约6-7秒 下面是我在应用程序中使用的web视图设置 webView.addJavascriptInterface(new HeaderCheckJSInterface(), "HTMLOUT"); webView.setLayerT

我使用Android web view在我的应用程序中加载网页,当我在长时间(约24小时)后打开应用程序时,完全加载数据需要40-50秒,但当我关闭应用程序并再次打开应用程序时,加载数据需要约6-7秒

下面是我在应用程序中使用的web视图设置

                webView.addJavascriptInterface(new HeaderCheckJSInterface(), "HTMLOUT");
            webView.setLayerType(View.LAYER_TYPE_HARDWARE, null);
            webView.getSettings().setJavaScriptEnabled(true);
            webView.getSettings().setJavaScriptCanOpenWindowsAutomatically(false); 
            webView.getSettings().setMediaPlaybackRequiresUserGesture(true);
            webView.getSettings().setDefaultTextEncodingName("UTF-8");
            webView.getSettings().setDomStorageEnabled(true);
            webView.getSettings().setDatabaseEnabled(true);
            webView.getSettings().setAllowFileAccess(true);
            webView.setVerticalScrollBarEnabled(false);
            webView.requestFocus(View.FOCUS_DOWN);
            webView.getSettings().setLoadWithOverviewMode(true);
            webView.getSettings().setUseWideViewPort(true);
            webView.getSettings().setSupportMultipleWindows(true);
这方面的任何线索或帮助都将是有益的

我怀疑一段时间后,应用程序的缓存正在清除,所有数据都会再次加载到应用程序中,因此如果有任何方法不让应用程序数据被清除

提前谢谢