zoukankan      html  css  js  c++  java
  • Android webview删除缓存问题

    我在自己和朋友的手机上,没有出现这个问题。

    android.database.sqlite.SQLiteException: no such table: password: , while compiling: SELECT username, password FROM password WHERE (host == ?) at android.database.sqlite.SQLiteCompiledSql.native_compile(Native Method) at android.database.sqlite.SQLiteCompiledSql.(SQLiteCompiledSql.java:68) at android.database.sqlite.SQLiteProgram.compileSql(SQLiteProgram.java:143) at android.database.sqlite.SQLiteProgram.compileAndbindAllArgs(SQLiteProgram.java:361) at android.database.sqlite.SQLiteProgram.(SQLiteProgram.java:127) at android.database.sqlite.SQLiteProgram.(SQLiteProgram.java:94) at android.database.sqlite.SQLiteQuery.(SQLiteQuery.java:53) at android.database.sqlite.SQLiteDirectCursorDriver.query(SQLiteDirectCursorDriver.java:47) at android.database.sqlite.SQLiteDatabase.rawQueryWithFactory(SQLiteDatabase.java:1684) at android.database.sqlite.SQLiteDatabase.queryWithFactory(SQLiteDatabase.java:1569) at android.database.sqlite.SQLiteDatabase.query(SQLiteDatabase.java:1525) at android.database.sqlite.SQLiteDatabase.query(SQLiteDatabase.java:1605) at android.webkit.WebViewDatabase.getUsernamePassword(WebViewDatabase.java:990) at android.webkit.BrowserFrame.handleMessage(BrowserFrame.java:589) at android.os.Handler.dispatchMessage(Handler.java:99) at android.os.Looper.loop(Looper.java:137) at android.webkit.WebViewCore$WebCoreThread.run(WebViewCore.java:950) at java.lang.Thread.run(Thread.java:856)

    我只用了webview,没有用sqlite,但是出现了了这个问题。

    网上搜了一下,问题肯能出在

    context.deleteDatabase("webview.db");
    context.deleteDatabase("webviewCache.db");

    也是网上关于删除缓存webview的代码。

    参考:

    http://stackoverflow.com/questions/13013769/strange-sqliteexception-not-in-all-devices

    http://stackoverflow.com/questions/8663227/android-webview-throws-sqliteexception

    觉得这个删除缓存的方法不太实用,我只是想在某个点去删除所有的缓存,这个方法不太适合:

    @Overridepublicvoid onPageFinished(WebView view,String url){

    super.onPageFinished(view, url); view.clearCache(true);

    }

    http://stackoverflow.com/questions/7537701/prevent-android-webview-caching-data

  • 相关阅读:
    168. Excel Sheet Column Title
    461. Hamming Distance
    Tree Representation Implementation & Traversal
    404. Sum of Left Leaves
    572. Subtree of Another Tree
    20. Valid Parentheses
    Check time of different search methods
    Binary search tree or not
    Coin Change
    JS DOM:文档对象模型 --树模型 文档:标签文档,对象:文档中每个元素对象,模型:抽象化的东西
  • 原文地址:https://www.cnblogs.com/aosting/p/3488817.html
Copyright © 2011-2022 走看看