mirror of
https://github.com/jfoucry/Pilldroid.git
synced 2024-11-22 04:29:22 +01:00
Use prefManager to update of not the main database
This commit is contained in:
parent
a55b3a7552
commit
766a7d7174
1 changed files with 5 additions and 1 deletions
|
@ -57,8 +57,12 @@ class DBMedoc extends SQLiteOpenHelper {
|
||||||
public synchronized SQLiteDatabase getReadableDatabase() {
|
public synchronized SQLiteDatabase getReadableDatabase() {
|
||||||
File dbFile = myContext.getDatabasePath(dbName);
|
File dbFile = myContext.getDatabasePath(dbName);
|
||||||
|
|
||||||
if (dbFile.exists()) return super.getReadableDatabase();
|
//if (dbFile.exists()) return super.getReadableDatabase();
|
||||||
|
|
||||||
|
PrefManager prefManager = new PrefManager(myContext);
|
||||||
|
int oldVersion = prefManager.getDatabaseVersion();
|
||||||
|
|
||||||
|
if (oldVersion == DATABASE_VERSION) return super.getReadableDatabase();
|
||||||
copyDatabase(dbFile.getPath());
|
copyDatabase(dbFile.getPath());
|
||||||
return super.getReadableDatabase();
|
return super.getReadableDatabase();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue