Skip to content

Commit

Permalink
Fix issue #9 to improve Reliability and remove Technical Debt
Browse files Browse the repository at this point in the history
  • Loading branch information
rextivlan committed Feb 14, 2024
1 parent 9785972 commit 87a44d6
Showing 1 changed file with 4 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -122,15 +122,14 @@ public boolean onCreate() {
*/
@VisibleForTesting
boolean onCreate(Context context) {
CustomSQLiteOpenHelper databaseHelper = new CustomSQLiteOpenHelper(context);
try {
try (CustomSQLiteOpenHelper databaseHelper = new CustomSQLiteOpenHelper(context)) {
db = databaseHelper.getWritableDatabase();
// Necessary to enable cascade deletion from Track to TrackPoints and Markers
db.setForeignKeyConstraintsEnabled(true);
} catch (SQLiteException e) {
} catch (SQLiteException e) {
Log.e(TAG, "Unable to open database for writing.", e);
}
return db != null;
}
return db != null;
}

@Override
Expand Down

0 comments on commit 87a44d6

Please sign in to comment.