[android-developers] Fragment init confusion

2011-04-10 Thread Brill Pappin
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

Re: [android-developers] Fragment init confusion

2011-04-10 Thread Dianne Hackborn
Any initialization that involves views associated with the fragment must be done in onCreateView() (or I guess later), since that is the place where you actually create and return your view hierarchy. There is basically no reason to use onRestoreInstanceState(), and no need for this with

Re: [android-developers] Fragment init confusion

2011-04-10 Thread Brill Pappin
But onCreate is called before onCreateView... which is where my confusion really stems from. The fact that I need to initialize my internal components in onCreateView means it has to happen after onCreate. Also, I'm not clear on whether i can access my internal components after calling

Re: [android-developers] Fragment init confusion

2011-04-10 Thread Dianne Hackborn
On Sun, Apr 10, 2011 at 1:07 AM, Brill Pappin bpap...@sixgreen.com wrote: But onCreate is called before onCreateView... which is where my confusion really stems from. The fact that I need to initialize my internal components in onCreateView means it has to happen after onCreate. Well any