我已經使用科爾多瓦3.6.3版本來建立我的android應用程序,我想在科爾多瓦webview中禁用URL緩存,我正在使用默認的cordova項目,使用index.html文件。 我試過,但它崩潰我的應用程序如何禁用科爾多瓦的緩存android應用
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);
}
}
您可能會發現這有幫助:http://stackoverflow.com/questions/22221395/turn-off-caching-on-android-for-webapps –
我試過這個,但我無法找到appView.getSettings( )在我的代碼 – Nishant
我已經在我的文章中共享代碼 – Nishant