Given the lifecycle of a Fragment, when would it be best to go get data for it? The samples so far have relied on simple built-in String and resource data, and it's been accessed in onActivityCreated(), which seems late to me. If I have a fragment that needs to read from a database, from the disk, or over the network, I'd want to get a background thread going early to pre-fetch the data so when my onActivityCreated() is called, my data might already be there for me to use. Is onInflate() too early? (I know, onInflate() is only called if my fragment is in a layout and that layout is inflated, such as when a layout is set as the content view of an activity) I won't have an Activity context until onAttach() is called so if I want to do anything that needs a context I'd have to wait until onAttach(). But maybe I should be waiting until onCreate() at least. Any guidelines here? I need to wait until any necessary data is available to my fragment, but could I start too early? Thank you in advance.
-- 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

