I'm attempting to convert an app from a standard activity based app to a 
fragment based app and I'm a bit confused on where I should place code that 
i used to have in onCreate(Bundle).

The lifecycle is pretty clear that the sequence is onCreate() -> 
onCreateView(). Additionally, it looks like onCreateView takes the place of 
onRestoreInstanceState in Activity.

Whats confusing me is i used to set the layout in the activity onCreate and 
then initialize most of my internal connections to view components (fairly 
standard stuff). However now since I have not set lay layout and I do 
explicitly load the fragment layout in onCreateView, where does all that 
init code that I used to put in onCreate go (leave it in onCreate() or move 
it to onCreateView)?
If i use onCreateView as a replacement for onRestoreInstanceState can I 
expect that my components initialized in onCreate to be available for the 
manual (read dynamic) restore?

If my components are already available because they were part of the 
activity's layout, why then am i loading the fragment's layout in the 
onCreateView() ?



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