Right! So by way of consensus <Google> is there a technique and/or pattern that handles the nuances surrounding a one-and-done background task? Seems like a documented pattern for such a common use case would benefit developers and app users alike.
On Wed, Sep 28, 2011 at 10:58 AM, Mark Murphy <[email protected]>wrote: > On Wed, Sep 28, 2011 at 11:41 AM, stanlick <[email protected]> wrote: > > Wouldn't this suffer the same fate when the activity experienced a > > configuration change? > > You probably pass the ResultReceiver to the new instance via > onRetainNonConfigurationInstance(). Make sure the ResultReceiver does > not have an implicit reference back to the old activity, but rather > has an explicit one that is reset in the onCreate() of the new > instance. > > IOW, it's the same basic pattern as I describe here for AsyncTask, > just with the ResultReceiver being the thing you're passing between > activity instances: > > > http://stackoverflow.com/questions/3821423/background-task-progress-dialog-orientation-change-is-there-any-100-working/3821998#3821998 > > -- > Mark Murphy (a Commons Guy) > http://commonsware.com | http://github.com/commonsguy > http://commonsware.com/blog | http://twitter.com/commonsguy > > Android App Developer Books: http://commonsware.com/books > > -- > 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 > -- 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

