Skip to content

Commit

Permalink
bugfix
Browse files Browse the repository at this point in the history
  • Loading branch information
nuclearfog committed Aug 18, 2018
1 parent 5944b70 commit c1f9ef0
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ public void store(final List<Trend> trends, int woeId) {
SQLiteDatabase db = dataHelper.getWritableDatabase();
ContentValues trendcolumn = new ContentValues();
String query = "DELETE FROM trend WHERE woeID=" + woeId;
db.beginTransaction();
db.execSQL(query); //Alte Einträge löschen
for(int pos = 0; pos < trends.size(); pos++) {
Trend trend = trends.get(pos);
Expand All @@ -62,6 +63,8 @@ public void store(final List<Trend> trends, int woeId) {
trendcolumn.put("trendlink", trend.link);
db.insertWithOnConflict("trend",null, trendcolumn,SQLiteDatabase.CONFLICT_REPLACE);
}
db.setTransactionSuccessful();
db.endTransaction();
db.close();
}
}

0 comments on commit c1f9ef0

Please sign in to comment.