I’ve the following code, it gives a run time error as below. Why?
try{
String myPath = DB_PATH + DB_NAME;
mDB = SQLiteDatabase.openDatabase(myPath, null, SQLiteDatabase.OPEN_READONLY);
}catch(SQLiteException e){}
Runtime Error:
:sqlite returned: error code = 1, msg = no such table: android_metadata
:SELECT locale FROM android_metadata failed
:Failed to setLocale() when constructing, closing the database
:android.database.sqlite.SQLiteException: no such table: android_metadata
Make sure the table name
android_metadatais there, with a column namelocale, you could insert en_US as value forlocale.Or rather execute this sql statement:
Edit: If you call openDatabase() with SQLiteDatabase.NO_LOCALIZED_COLLATORS flag, you would not need to have this table, else you will need to have this table around.
See setLocale().