I have a ListActivity that starts a service. In this service, I started a thread that does some database query of up to 800 contacts, this seems to be slowing down or even hanging the UI sometimes. Should I be using AsyncTask instead? What is the proper way to handle this?
Share
Normally services are running on UI-Thread.
But you had mentioned that you are using thread in services it mean your work is doing in background so there is no any possibility to block UI-Thread.
I think you had write a some code out of thread for update UI and that may be blocking your UI.
You can use
AsyncTaskinstead of starting service and updating using thread because asynctask is doing same thing as background thread can do.