On Tue, Aug 23, 2011 at 2:03 AM, Dianne Hackborn <[email protected]> wrote:
> The first thing to mention is that I deprecated
> onRetainNonConfigurationInstance() because the new fragment APIs are much
> easier to deal with than that old method.  If you are currently using
> onRetainNonConfigurationInstance() and that is working well for you, there
> is no need to move off it.  (In fact that method is fundamental to how the
> support lib's FragmentActivity is able to work.)

If I want to extend FragmentActivity I kind of have to, since it's final.
I did notice it's handling both fragments and loader managers in
FragmentActivity.

>
> As far as errors from loaders, the design is that there are no errors as
> such.  Ultimately they need to deliver a result back to the
> activity/fragment.  If your result can include an error state, then this
> should be part of the result you deliver.  This should be as simple as
> wrapping your result data in a container class that has it and the error
> state, and making that the result.

OK, thanks. I guess I'll just add a generic result-wrapping class. The
docs should probably point out that one shouldn't let exception get out
of loadInBackground() though.

Another thing to watch out for (that's mentioned in the docs): if initLoader()
is not called from onCreate(), but from say onResume(), the loader will be
properly retained but won't start after a configuration change.

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