Is it ok to perform DB operation on UI thread?
Posted
by
user648462
on Stack Overflow
See other posts from Stack Overflow
or by user648462
Published on 2012-11-17T15:57:01Z
Indexed on
2012/11/17
17:01 UTC
Read the original article
Hit count: 239
I am using a database to persist the state of a search form. I am using the onPause method to persist the data and the onResume method to restore it. My opinion is that restoring and persisting state should be a blocking operation so I plan to perform the database operations on the UI thread. I know this is generally discouraged but the operations should be quick and I think if they were done asynchronously they could lead to inconsistent UI behaviour.
Any advice
© Stack Overflow or respective owner