Good point, use you need the IBinder as well.

And yes it could be easier.

And thus Fragment retaining was born. :)

On Mon, Aug 8, 2011 at 9:24 AM, Mark Murphy <[email protected]> wrote:

> On Mon, Aug 8, 2011 at 12:18 PM, Dianne Hackborn <[email protected]>
> wrote:
> > Doing this with an Activity isn't *too* hard:
>
> Well, you also have to pass the IBinder object, since you can't get
> that any other way. And, in the OP's case, you have to pass the
> AsyncTask too, so it can be attached to the new activity instance. And
> if you supplied some sort of listener interface to the service for
> callbacks, you have to pass that as well, all via
> onRetainNonConfigurationInstance().
>
> None of these are intrinsically difficult, but trying to explain it to
> newcomers to Android (e.g., students in a course) is not especially
> pleasant.
>
> --
> Mark Murphy (a Commons Guy)
> http://commonsware.com | http://github.com/commonsguy
> http://commonsware.com/blog | http://twitter.com/commonsguy
>
> Android 3.1 Programming 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
>



-- 
Dianne Hackborn
Android framework engineer
[email protected]

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 [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

Reply via email to