android - Do I always need to move Database queries from the UI thread to a separate thread? -
This question comes from an issue I'm doing or something really confusing. So to query the database on the UI thread it frowned on. But my problem is that what happens on the screen, what happens on the results Should you still run it in the background, or should you stop the output of the screen until you need the information from the database?
The way you should set it, use it as Hopefully that makes sense, if not, here are some articles that can help: < / P> Good luck! asincot To query the database, use the
doInBackground method. Then use the
onPostExecute method to update the UI You can not update the UI on any other thread from the main thread.
Comments
Post a Comment