Здравствуйте, Mishka, Вы писали:
M>Так что AsyncTask >> background service.
По твоей ссылке на so принятый ответ:
The AsyncTask is tied to a UI thread and if the Activity is finished the async task is canceled.
[update] — Hackbod's comment below is correct. It should be noted that AsyncTasks are meant to be short lived and as such not worry so much about this issue. An AsycTask is only truly gone when it is completed OR the process is killed which may or may not happen after finish is called.
Коммент, на который ты ссылаешься, неправильный, как примерно 40% на so. Дело не в смерти активити, а в том, что может убиться все, кроме foreground service.
См. "жизненный цикл процесса — иерархия важности" в
http://developer.android.com/intl/ru/guide/components/processes-and-threads.html
На странице моей ссылки(документация Android):
A started service can use the startForeground(int, Notification) API to put the service in a foreground state, where the system considers it to be something the user is actively aware of and thus not a candidate for killing when low on memory. (It is still theoretically possible for the service to be killed under extreme memory pressure from the current foreground application, but in practice this should not be a concern.)
У сложных вещей обычно есть и хорошие, и плохие аспекты.
Берегите Родину, мать вашу. (ДДТ)