I am able to fetch contacts using this code https://stackoverflow.com/a/1780818/992774 , it works perfectly fine and returns all the emails and phone numbers.
But my problem is that when I have 10,000 of contacts it takes about 3-4 minutes and for that time it blocks my UI and looks like my app got halted. I have seen many apps like groupme which shows contacts without taking any time.
Can anyone suggest how to reduce the time while fetching contact thousand of contacts or how can I create custom cursor adapter?
I am able to fetch contacts using this code https://stackoverflow.com/a/1780818/992774 , it works perfectly
Share
Can you do the loading in a separate thread, either using a Handler or an AsyncTask, for an example please refer to this tutorial http://www.vogella.de/articles/AndroidPerformance/article.html
This will leave your UI thread to be free to do UI stuff and you should be able to see your contacts get populated one by one on your screen.