我正在播放视频,因此它会缓存大量数据。我无法在其他手机中删除xperia mini中的缓存它工作正常。
我试过
mWebview.clearCache(true);
和
File cacheDir = this.getCacheDir();
File[] files = cacheDir.listFiles();
if (files != null) {
for (File file : files)
file.delete();
}
但总是在log-cat中出错:
01-18 10:31:00.878: E/AndroidRuntime(2364): FATAL EXCEPTION: WebViewWorkerThread
01-18 10:31:00.878: E/AndroidRuntime(2364): android.database.sqlite.SQLiteDiskIOException: error code 10: disk I/O error
01-18 10:31:00.878: E/AndroidRuntime(2364): at android.database.sqlite.SQLiteStatement.native_execute(Native Method)
01-18 10:31:00.878: E/AndroidRuntime(2364): at android.database.sqlite.SQLiteStatement.execute(SQLiteStatement.java:61)
01-18 10:31:00.878: E/AndroidRuntime(2364): at android.database.sqlite.SQLiteDatabase.delete(SQLiteDatabase.java:1640)
01-18 10:31:00.878: E/AndroidRuntime(2364): at android.webkit.WebViewDatabase.clearCache(WebViewDatabase.java:707)
01-18 10:31:00.878: E/AndroidRuntime(2364): at android.webkit.CacheManager.clearCache(CacheManager.java:582)
01-18 10:31:00.878: E/AndroidRuntime(2364): at android.webkit.WebViewWorker.handleMessage(WebViewWorker.java:194)
01-18 10:31:00.878: E/AndroidRuntime(2364): at android.os.Handler.dispatchMessage(Handler.java:99)
01-18 10:31:00.878: E/AndroidRuntime(2364): at android.os.Looper.loop(Looper.java:130)
01-18 10:31:00.878: E/AndroidRuntime(2364): at android.os.HandlerThread.run(HandlerThread.java:60)