I'm trying to open a new fragment automatically from the onCreate() method of my original fragment. I found this code via How do i open a new fragment from another fragment. The only thing I'm confused about is the resource element. What does R.id.layout refer to in this particular case? What is the resource being replaced? It's asking for the containerViewId. What is that?
TemplateFragment nextFrag = new TemplateFragment();
this.getFragmentManager().beginTransaction()
.replace(R.id.layout, nextFrag, TAG_FRAGMENT)
.addToBackStack(null)
.commit();