访问页面添加
<meta HTTP-EQUIV="pragma" CONTENT="no-cache"> <meta HTTP-EQUIV="Cache-Control" CONTENT="no-cache, must-revalidate"> <meta HTTP-EQUIV="expires" CONTENT="0">
主active ,修改onCreate函数 super.clearCache();
注意代码的顺序
@Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); super.setBooleanProperty("loadInWebView", true); super.setIntegerProperty("splashscreen", R.drawable.a); super.clearCache(); ConnectivityManager cwjManager=(ConnectivityManager)getSystemService(Context.CONNECTIVITY_SERVICE); NetworkInfo info = cwjManager.getActiveNetworkInfo(); if (info != null && info.isAvailable()){ super.loadUrl("http://192.168.55.175:5000",10000); // super.loadUrl("http://www.baidu.com",3000); }else{ super.loadUrl("file:///android_asset/www/error.html",2000); // super.loadUrl("http://www.xxx.com",4500); } }
时间: 2024-10-28 22:22:38