Check out this link - http://www.paxmodept.com/telesto/blogitem.htm?id=766
This works great without calling a service. On 30-May-09, at 2:03 AM, Mark Murphy wrote: > > Robert Green wrote: >> Are you trying to tell me that it's totally safe to throw stuff in >> static fields? > > I wouldn't go with "totally safe", but it's an unfortunate requirement > in some Android cases (e.g., sharing a WakeLock between a > BroadcastReceiver triggered by AlarmManager and a Service doing the > actual work being scheduled to run in the background). > >> I've always avoided it because of years of shared >> space in a JVM in web apps. I know Android uses separate processes >> for each application but is it safe to say that it will kill all of >> your static allocations even if you don't clean them up properly? > > Garbage collection rules still hold, until the whole process is killed > (or, I assume, recycled -- I sincerely hope they flush the heap when > they reuse an existing process). > > -- > Mark Murphy (a Commons Guy) > http://commonsware.com | http://twitter.com/commonsguy > > Need Android talent? Ask on HADO! http://wiki.andmob.org/hado > > > --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---

