NClientV2 icon indicating copy to clipboard operation
NClientV2 copied to clipboard

Potential blocking issues on the UI thread

Open nbd-boss opened this issue 1 month ago • 1 comments

  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.

nbd-boss avatar Nov 21 '25 11:11 nbd-boss

Project is abandoned, see https://github.com/Dar9586/NClientV2/issues/785 for more information. And if possible, close the issue here so that the fork notification is on top.

maxwai avatar Nov 30 '25 12:11 maxwai