Saturday, June 25, 2011

Re: [android-developers] Re: What are your thoughts on this service - activity communication pattern?

If the service process is killed, it won't have its onDestroy called,
and won't have a chance to update shared preferences indicating it's not
running.

-- Kostya

25.06.2011 23:06, m.andrew пишет:
>> But with this design I
>> can't handle cases where the job finishes, but the Acitivity is not
>> resumed
>
> You could control the state of your service using SharedPreferences.
> Call getSharedPreferences() in onDestroy() method of your service and
> save the state. Do the same thing in resumed/restored activity to
> check the state of your service.
>


--
Kostya Vasilyev

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

No comments:

Post a Comment