On Thu, Oct 29, 2009 at 1:20 PM, Loki117 <thomas.shepparduk@gmail.com> wrote:
Agreed going forward this is a better plan and something which I am
moving towards but with my current inherited code base this is not a
possible so "don't do that" isn't really an option for the moment.
On Oct 29, 4:15 pm, "Mark Murphy" <mmur...@commonsware.com> wrote:
> > Because the service implements an interface to which I require access
> > to by casting the context to it's type.
>
> Then don't do that.
>
> One solid pattern for AlarmManager is to have alarms trigger a
> manifest-registered broadcast receiver, that in turn calls startService()
> on an IntentService that processes whatever work needs to be done
> periodically. This allows the work to be done on a background thread and
> shuts the IntentService down when there is no more work, minimizing memory
> impact.
>
> Conversely, I really do not recommend trying to use AlarmManager with a
> receiver registered in Java code, because that receiver hopefully is
> rarely around, because the service that hosts it hopefully is rarely
> around.
>
> --
> Mark Murphy (a Commons Guy)http://commonsware.com
> Android App Developer Books:http://commonsware.com/books.html
--
Dianne Hackborn
Android framework engineer
hackbod@android.com
Note: please don't send private questions to me, as I don't have time to provide private support, and so won't reply to such e-mails. All such questions should be posted on public forums, where I and others can see and answer them.
--~--~---------~--~----~------------~-------~--~----~
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