1

Relationship between Fragment.onCreate() and Activity.onCreate()

view story
linux-howto

http://stackoverflow.com – Dear fellow developers, The relationship between a Fragment's onCreate() method and that of an Activity is not yet crystal clear to me. I'm attaching a Fragment to an Activity like this. //happens in the Activity: protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); FragmentManager fragMan = this.getSupportFragmentManager(); Fragment dataModelFragment = fragMan.findFragmentByTag("data_model"); if (dataModelFragment == null) { dataModelFragment = new DataModelFragment(); fragMan.beginTransaction().add(dataModelFragment,"data (HowTos)