tags:

views:

30

answers:

1

I am working on an application to sync contacts which are large in number. The syncing takes place in a background thread with user being able to browse through the rest of the application. I am displaying the sync status in the notification bar suing the progress bar.

The problem I am facing is that there are instances when the activity is killed and hence the background thread used for syncing the contacts is purged.

Can this situation be avoided in any case?

+1  A: 

I use and aidl service when I don't want my background threads to be tied to the Activity. That way, really long running tasks will still be running when the Activities are all paused and could be potentially cleaned up. Designing a Remote Interface Using AIDL

Rich