• 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

  • 相关阅读:
    java实现AVL树
    java实现队列
    java实现双向链表
    java实现堆
    swagger导出离线文档
    java实现二叉查找树
    java实现二叉树遍历
    java实现栈
    Java实现单源最短路径算法(Dijkstra 算法)
    docker安装SqlServer2019
  • 原文地址:https://www.cnblogs.com/aosting/p/3488817.html
Copyright © 2020-2023  润新知