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 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.

Hopefully that makes sense, if not, here are some articles that can help:

< / P>

Good luck!

Comments

Popular posts from this blog

Python SQLAlchemy:AttributeError: Neither 'Column' object nor 'Comparator' object has an attribute 'schema' -

java - How not to audit a join table and related entities using Hibernate Envers? -

mongodb - CakePHP paginator ignoring order, but only for certain values -