Reputation: 1080
I'm using BugSense to track down errors in my app, and it just caught one related to SQLite... the problem is that I don't use SQLite. I use sharedPreferences and ads though, but no SQLite at all...
Why is this happening? Bad SD card or no space? Should I surround the sharedPreferences code with a try catch block just in case?
Here is the stacktrace:
android.database.sqlite.SQLiteDiskIOException: disk I/O error
at android.database.sqlite.SQLiteDatabase.native_setLocale(Native Method)
at android.database.sqlite.SQLiteDatabase.setLocale(SQLiteDatabase.java:2074)
at android.database.sqlite.SQLiteDatabase.openDatabase(SQLiteDatabase.java:1014)
at android.database.sqlite.SQLiteDatabase.openDatabase(SQLiteDatabase.java:986)
at android.database.sqlite.SQLiteDatabase.openDatabase(SQLiteDatabase.java:962)
at android.database.sqlite.SQLiteDatabase.openOrCreateDatabase(SQLiteDatabase.java:1043)
at android.database.sqlite.SQLiteDatabase.openOrCreateDatabase(SQLiteDatabase.java:1036)
at android.app.ContextImpl.openOrCreateDatabase(ContextImpl.java:771)
at android.content.ContextWrapper.openOrCreateDatabase(ContextWrapper.java:215)
at android.webkit.WebViewDatabase.initDatabase(WebViewDatabase.java:227)
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)
And more data from BugSense:
Upvotes: 0
Views: 1111
Reputation: 107
I found that if you using more than 2 webviews inside the same window, SQLiteDiskIOException may happen. So it is recommended that just use single webview in your activity
Upvotes: 0
Reputation: 1007265
Why is this happening?
You are using a WebView
, and it uses SQLite under the covers (for its cache IIRC). As to why you are getting a disk I/O error, that's difficult to say with any certainty, given the info in front of you.
Bad SD card or no space?
WebView
will store its database on internal storage, so it won't be a bad SD card.
Being out of internal storage is certainly possible.
Should I surround the sharedPreferences code with a try catch block just in case?
Since this has nothing to do with your SharedPreferences
, I doubt that it will help.
Moreover, unless you see this occurring a lot, I would assume it is a device-specific problem (e.g., out of internal storage).
Upvotes: 3