This solution has problems. If the address book service is not running when you launch the app and you have many contacts the spinner stops after two seconds and the screen is still blank. Then after like 10 seconds the results show up.
A better way to implement this
1) start the spinner when app starts
2) to do an initial query for the number of contacts found on the server
3) if result is 0, stop spinner
4) else stop after you've received first page of results
This solution has problems. If the address book service is not running when you launch the app and you have many contacts the spinner stops after two seconds and the screen is still blank. Then after like 10 seconds the results show up.
A better way to implement this
1) start the spinner when app starts
2) to do an initial query for the number of contacts found on the server
3) if result is 0, stop spinner
4) else stop after you've received first page of results