Got stuck in "no such table"

This commit is contained in:
LucasGGamerM
2023-01-22 12:26:48 -03:00
parent c695bb6aa3
commit bed71fd9e0
2 changed files with 15 additions and 3 deletions

View File

@@ -157,7 +157,7 @@ public class CacheController{
return;
}
}catch(IOException x){
Log.w(TAG, "getHomeTimeline: corrupted status object in database", x);
Log.w(TAG, "getConversationsTimeline: corrupted status object in database", x);
}
}
new GetConversationsTimeline(maxID, null, count, null)
@@ -393,15 +393,18 @@ public class CacheController{
)""");
createRecentSearchesTable(db);
createPostsNotificationsTable(db);
createConversationsTimelineTable(db);
}
@Override
public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion){
if(oldVersion==1){
createRecentSearchesTable(db);
createConversationsTimelineTable(db);
}
if(oldVersion==2){
createPostsNotificationsTable(db);
createConversationsTimelineTable(db);
}
}
@@ -423,6 +426,15 @@ public class CacheController{
`type` INTEGER NOT NULL
)""");
}
private void createConversationsTimelineTable(SQLiteDatabase db){
db.execSQL("""
CREATE TABLE `conversations_timeline` (
`id` VARCHAR(25) NOT NULL PRIMARY KEY,
`json` TEXT NOT NULL,
`flags` INTEGER NOT NULL DEFAULT 0
)""");
}
}
@FunctionalInterface

View File

@@ -92,7 +92,7 @@ public class NotificationsFragment extends MastodonToolbarFragment implements Sc
} else if (item.getItemId() == R.id.clear_notifications) {
UiUtils.confirmDeleteNotification(getActivity(), accountID, null, ()->{
for (int i = 0; i < tabViews.length; i++) {
getFragmentForPage(i).reload();
// getFragmentForPage(i).reload();
}
});
return true;
@@ -202,7 +202,7 @@ public class NotificationsFragment extends MastodonToolbarFragment implements Sc
@Override
public void scrollToTop(){
getFragmentForPage(pager.getCurrentItem()).scrollToTop();
// getFragmentForPage(pager.getCurrentItem()).scrollToTop();
}
public void loadData(){