Hi all,

I'm getting reports from some of my app's users that on occasion they
are loosing data (e.g. no save occurs). I cannot reproduce the issue,
but I have a feeling it's because my save operation is taking too long
in onPause() resulting in a process kill in lower memory situations.

I've noticed that if I keep an idle service in the app, it seems like
Android is much less likely to kill it during a slow onPause()
operation.

In the hopes of solving this without introducing an idle service (or
changing when/how I save things) I decided to use a ServiceIntent
which I launch during onPause(). There I do all of the saving in
onHandleIntent(...). I also use a public static Semaphore in order to
keep the app from trying to load while the ServiceIntent is still
saving.

Is this crazy? Is there a better way to just ensure onPause() sticks
around when things take a while? Or am I missing a totally different
approach I can pursue?

Any advice is greatly appreciated!
Thanks.

-- 
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+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to