Fix potential crashes due to cash clean
This commit is contained in:
parent
fc5b2563c4
commit
23a184e6c7
|
@ -6,8 +6,8 @@ android {
|
|||
defaultConfig {
|
||||
minSdkVersion 16
|
||||
targetSdkVersion 28
|
||||
versionCode 269
|
||||
versionName "2.0.1"
|
||||
versionCode 270
|
||||
versionName "2.0.2"
|
||||
multiDexEnabled true
|
||||
renderscriptTargetApi 28 as int
|
||||
renderscriptSupportModeEnabled true
|
||||
|
|
|
@ -990,17 +990,21 @@ public class API {
|
|||
|
||||
SQLiteDatabase db = Sqlite.getInstance(context, Sqlite.DB_NAME, null, Sqlite.DB_VERSION).open();
|
||||
statuses = new TimelineCacheDAO(context, db).get(max_id);
|
||||
Iterator<Status> i = statuses.iterator();
|
||||
List<String> ids = new ArrayList<>();
|
||||
while (i.hasNext()) {
|
||||
Status s = i.next();
|
||||
if( ids.contains(s.getId())) {
|
||||
i.remove();
|
||||
new TimelineCacheDAO(context, db).remove(s.getId());
|
||||
}else{
|
||||
ids.add(s.getId());
|
||||
|
||||
if( statuses != null){
|
||||
Iterator<Status> i = statuses.iterator();
|
||||
List<String> ids = new ArrayList<>();
|
||||
while (i.hasNext()) {
|
||||
Status s = i.next();
|
||||
if( ids.contains(s.getId())) {
|
||||
i.remove();
|
||||
new TimelineCacheDAO(context, db).remove(s.getId());
|
||||
}else{
|
||||
ids.add(s.getId());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if( statuses == null){
|
||||
return getHomeTimeline(max_id);
|
||||
}else{
|
||||
|
|
Loading…
Reference in New Issue