Hi Everyone,

I am currently working on an app that uses two threads: The first main
UI one and a secondary one that I use to retrieve some data from the
network, parse them and finally add them into a database.

My question is regarding to the lifecycle of my thread. The problem is
simple, I need the thread to end the work it is doing.

The user can close the activity or send it to the background at
anytime which is not a problem for the main thread that take cares of
the UI but the  secondary thread is still running and can be killed at
anytime stopping its work in a way that we don't control anything
(could be working on the database, parsing...).

What is the best solution to handle this problem?

Thanks a lot in advance.
Polo

--~--~---------~--~----~------------~-------~--~----~
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