On Sun, Mar 4, 2012 at 3:44 PM, Romain Guidoux <[email protected]> wrote:
> Well, I did not absolutely wanted to wait in the onDestroy() method,
> but I wanted my thread stuff to terminate in a good and safe state.
> But now I know that a running thread cannot be GC, I have no reason to
> wait anymore.

Now, there *is* a chance that your process will be terminated shortly
after onDestroy() is called, taking your threads with you.

If whatever you are doing is something the user should be aware of,
use startForeground() and stopForeground() during your file transfers
to minimize the odds of having the service destroyed and process
terminated.

In general, though, you need to take into account that your current
transfer may be cancelled (by means of the process being terminated),
so you should be in position to pick up from where you left off at
such time as your app runs again.

-- 
Mark Murphy (a Commons Guy)
http://commonsware.com | http://github.com/commonsguy
http://commonsware.com/blog | http://twitter.com/commonsguy

Android Training in NYC: http://marakana.com/training/android/

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to