Skip to content

Potential blocking issues on the UI thread #109

@nbd-boss

Description

@nbd-boss

Checklist

  • I have searched the existing issues for the same bug
  • I have attached the log file as an attachment to this issue

Describe the bug

  1. In SearchActivity.java, the onCreate method calls populateGroup, which performs numerous synchronous database operations. According to Android best practices, these potentially time-consuming database operations should be moved off the UI thread to prevent UI blocking when handling large datasets or complex operations.

  2. In StatusViewerActivity.java, the getCountPerStatus method used by getPageTitle, which is called in onResume, also involves database queries and should therefore be moved off the UI thread.

  3. In HistoryActivity.onCreate(), calling getHistory() performs a SQLite query and creates objects. If the history is large, it can block the UI. It should run on a background thread, with the UI thread only responsible for updating the interface.

  4. In GalleryActivity.onCreate(), calling addGallery() performs a SQLite insert. If the data is large, it can block the UI. It is recommended to execute database writes on a background thread and update the UI only on the UI thread.

Steps To Reproduce

nothing

Expected behavior

Potentially time-consuming operations should not be executed on the UI thread.

Screenshots

No response

Android Version

13

App Version

4.1.2

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions