WebViewDatabase中出现崩溃

时间:2014-07-14 07:27:34

标签: android webview

android.database.sqlite.SQLiteDiskIOException: error code 10: disk I/O error
    at android.database.sqlite.SQLiteStatement.native_1x1_long(Native Method)
    at android.database.sqlite.SQLiteStatement.simpleQueryForLong(SQLiteStatement.java:138)
    at android.database.DatabaseUtils.longForQuery(DatabaseUtils.java:790)
    at android.database.DatabaseUtils.longForQuery(DatabaseUtils.java:778)
    at android.database.sqlite.SQLiteDatabase.getVersion(SQLiteDatabase.java:1239)
    at android.webkit.WebViewDatabase.initDatabase(WebViewDatabase.java:254)
    at android.webkit.WebViewDatabase.init(WebViewDatabase.java:209)
    at android.webkit.WebViewDatabase.access$000(WebViewDatabase.java:38)
    at android.webkit.WebViewDatabase$1.run(WebViewDatabase.java:190)

我在我的应用中添加了一个数据库,代码如下:

    settings.setAppCacheEnabled(true);
    settings.setAppCacheMaxSize(1024 * 1024 * 8);
    String appCacheDir = getContext().getDir("cache", Context.MODE_PRIVATE).getPath();
    settings.setAppCachePath(appCacheDir);

    settings.setAllowFileAccess(true);
    settings.setCacheMode(WebSettings.LOAD_DEFAULT);
    settings.setDatabaseEnabled(true);
    settings.setDomStorageEnabled(true);
    String dbDir = getContext().getDir("database", Context.MODE_PRIVATE).getPath();
    settings.setDatabasePath(dbDir);

除了浏览器需要webview中的数据库设置吗?如果删除数据库设置,会发生错误吗?

0 个答案:

没有答案