【发布时间】:2016-11-06 21:13:02
【问题描述】:
我曾使用 Cordova 3.6.3 版本来构建我的 android 应用程序,并且我想禁用在 cordova webview 中的 URL 缓存,为此我正在使用默认的 cordova 项目并使用 index.html 文件。 我试过了,但它让我的应用程序崩溃了
public class MyClass extends CordovaActivity
{
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
mwebview=(WebView) findViewById(R.id.appView);
WebSettings ws=mwebview.getSettings();
ws.setAppCacheEnabled(false);
ws.setCacheMode(WebSettings.LOAD_NO_CACHE);
// Set by <content src="index.html" /> in config.xml
loadUrl(launchUrl);
}
}
【问题讨论】:
-
您可能会发现这很有帮助:stackoverflow.com/questions/22221395/…
-
我试过了,但我无法在我的代码中找到 appView.getSettings()
-
我在帖子中分享了代码
标签: android cordova caching cordova-3