diff options
author | Christian Schneppe <christian@pix-art.de> | 2016-06-06 20:04:44 +0200 |
---|---|---|
committer | Christian Schneppe <christian@pix-art.de> | 2016-06-06 20:04:44 +0200 |
commit | c4489fb8ab71eae6005f3dcbb24eaa717f9e66d8 (patch) | |
tree | aa06475fa5bc7528f3fbea044b734ce808204c96 /src/main/java/eu/siacs | |
parent | 29a8516a741951ef793cff523e81f971091fe239 (diff) |
fix crash in welcome screen on first start
Diffstat (limited to 'src/main/java/eu/siacs')
-rw-r--r-- | src/main/java/eu/siacs/conversations/ui/WelcomeActivity.java | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/main/java/eu/siacs/conversations/ui/WelcomeActivity.java b/src/main/java/eu/siacs/conversations/ui/WelcomeActivity.java index 56bae7b39..1ef349df0 100644 --- a/src/main/java/eu/siacs/conversations/ui/WelcomeActivity.java +++ b/src/main/java/eu/siacs/conversations/ui/WelcomeActivity.java @@ -88,10 +88,12 @@ public class WelcomeActivity extends Activity { String DB_PATH = Environment.getExternalStorageDirectory().getAbsolutePath() + "/Pix-Art Messenger/.Database/"; String DB_NAME = "Database.bak"; int DB_Version = DatabaseBackend.DATABASE_VERSION; + int Backup_DB_Version = 0; try { String dbPath = DB_PATH + DB_NAME; checkDB = SQLiteDatabase.openDatabase(dbPath, null, SQLiteDatabase.OPEN_READONLY); + Backup_DB_Version = checkDB.getVersion(); Log.d(Config.LOGTAG, "Backup found: " + checkDB + " Version: " + checkDB.getVersion()); } catch (SQLiteException e) { @@ -101,7 +103,7 @@ public class WelcomeActivity extends Activity { if (checkDB != null) { checkDB.close(); } - if (checkDB != null && checkDB.getVersion() <= DB_Version) { + if (checkDB != null && Backup_DB_Version <= DB_Version) { return true; } else { return false; |