fixed ConcurrentModificationException
This commit is contained in:
parent
2f551d4c63
commit
5daa72b995
@ -56,8 +56,9 @@ public class TimelineAdapter extends Adapter<TimelineAdapter.ItemHolder> {
|
||||
|
||||
|
||||
public void setData(List<Tweet> newTweets) {
|
||||
newTweets.addAll(tweets);
|
||||
tweets = newTweets;
|
||||
List<Tweet> result = new ArrayList<>(newTweets);
|
||||
result.addAll(tweets);
|
||||
tweets = result;
|
||||
}
|
||||
|
||||
|
||||
|
@ -126,6 +126,23 @@ public class DatabaseAdapter {
|
||||
commit(db);
|
||||
}
|
||||
|
||||
/**
|
||||
* Speichere Twitter Trends
|
||||
*
|
||||
* @param trends List of Trends
|
||||
* @param woeId Yahoo World ID
|
||||
*/
|
||||
public void store(final List<Trend> trends, int woeId) {
|
||||
SQLiteDatabase db = getDbWrite();
|
||||
String query = "DELETE FROM trend WHERE woeID=" + woeId;
|
||||
db.beginTransaction();
|
||||
db.execSQL(query);
|
||||
for (Trend trend : trends) {
|
||||
storeTrends(trend, woeId, db);
|
||||
}
|
||||
commit(db);
|
||||
}
|
||||
|
||||
/**
|
||||
* Speichere Tweet in Favoriten Tabelle
|
||||
*
|
||||
@ -150,23 +167,6 @@ public class DatabaseAdapter {
|
||||
commit(db);
|
||||
}
|
||||
|
||||
/**
|
||||
* Speichere Twitter Trends
|
||||
*
|
||||
* @param trends List of Trends
|
||||
* @param woeId Yahoo World ID
|
||||
*/
|
||||
public void store(final List<Trend> trends, int woeId) {
|
||||
SQLiteDatabase db = getDbWrite();
|
||||
String query = "DELETE FROM trend WHERE woeID=" + woeId;
|
||||
db.beginTransaction();
|
||||
db.execSQL(query);
|
||||
for (Trend trend : trends) {
|
||||
storeTrends(trend, woeId, db);
|
||||
}
|
||||
commit(db);
|
||||
}
|
||||
|
||||
/**
|
||||
* speicher direktnachrichten
|
||||
*
|
||||
|
Loading…
x
Reference in New Issue
Block a user