webview에서 HTML5 매니페스트가 요청한 파일을 캐시했을 때를 알 수있는 방법이 있습니까? 여기 appcache가 완료되면 어떻게 알 수 있습니까?
는 내가 뭘하지만 오프라인 (일부 이미지 누락) 때 불완전 디스플레이를 끝낼 수 있었다 무엇//v is my WebView instance
String cachePath = "/data/data/"+getPackageName()+"/cache";
v.getSettings().setAppCachePath(cachePath);
v.getSettings().setAppCacheMaxSize(1024*1024*4); // 4Mo default cache size
v.getSettings().setAllowFileAccess(true);
v.getSettings().setAppCacheEnabled(true);
v.getSettings().setDomStorageEnabled(true);
ConnectivityManager cm = (ConnectivityManager)this.getSystemService(Activity.CONNECTIVITY_SERVICE);
NetworkInfo netInfos = cm.getActiveNetworkInfo();
if(null != netInfos && netInfos.isConnected()) {
v.getSettings().setCacheMode(WebSettings.LOAD_NO_CACHE);
}
else {
File f = new File(cachePath);
if(f.exists()){
v.getSettings().setCacheMode(WebSettings.LOAD_CACHE_ONLY);
}
else{
url = fallbackUrl;
}
}
내가 캐시가 완료되면 알림을하거나 더 나은 것이 있는지 알고 싶습니다
캐시 디렉토리가 "손상"되었습니까?
당신은 ['캐시 된'및'updateready' 이벤트들]에 접근 할 수 있습니까 (http://www.whatwg.org/specs/web-apps/current-work/multipage/offline.html#event-appcache- 캐시 된)? – robertc
Js 측에서 의미가 있습니까? 그렇다면 예. 나는 그것을 검사 할 것이다. 감사합니다 – noobypapa