title: layout with fragment and framelayout replaced by another fragment and framelayout
body: <p><strong>EDIT:</strong></p>
  
  <p>So after the comments below, I revisted and realized what was hanging me up.</p>
  
  <p>Imagine my client list and client details activity be started by :</p>
  
  <pre><code>public class ClientsMainActivity extends FragmentActivity {
      @Override
      public void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          //StudioTabOpenHelper db;
          setContentView(R.layout.main_client_activity);
      }
  }
  </code></pre>
  
  <p>So this works great, starts up my main_client_Activity (defined in a layout below, and i call this activity when a button on my main screen is clicked):</p>
  
  <pre><code>Intent intent = new Intent(getActivity(), ClientsMainActivity.class);
  startActivity(intent);
  </code></pre>
  
  <p>Easy the issue is, the <code>ClientsMainActivity</code> does not call a OnCreateView or anything, just sets the layout to the layout that defines my Fragment, and my ListFragment.  This is fine cause I am not trying to pass anything into the <code>ClientsMainActivity</code>, but if I have a hypothetical activity like:</p>
  
  <p><code>SessionMainsActivity</code> that is called when they click on the session edit of a client, then I would not be calling the <code>SessionsMainActivity</code> the same way (starts activity that just sets to alayout), i would want that layout set as it defines how my fragments are split up.  But I would also want to pass in data to that and then to the subsequent fragments (like which session they clicked on to be editing/mucking with.</p>
  
  <p>So I wonder if the above makes sense, I am sure its a simple thing I just cannot wrap my brain around.  I have no issues calling <code>FragmentActivitie</code>s from other fragments, they take up the whole screen but it works.  So I guess the big issue is that <code>ClientsMainActivity</code> is from some example I found online for doing recipes that shows you how to make multiple fragments to a screen.  The thing that gets me all that <code>FragmentActivity</code> does is sets the content view, to a layout that does all the work it seems, so that's why I cannot figure out how I would code it to do the same thing but let me pass in values to the fragments the layout defines etc... </p>
  
  <p><strong>END EDIT</strong></p>
  
  <p>So I am using this nice little tutorial here:</p>
  
  <p><a href="http://developer.android.com/guide/topics/fundamentals/fragments.html" rel="nofollow">http://developer.android.com/guide/topics/fundamentals/fragments.html</a></p>
  
  <p>It has gotten me a long way and utilizing what they say to do for the main activity, and the fragment_layout.xml, I got a nice client list on the left (Thats a listfragment) and a details fragment on the right.</p>
  
  <p>Then i added the ability to edit session information on a client (or edit client details) both of which were full screen fragments.  This worked great.</p>
  
  <p>Now I decided my Session edit ui would best be served splitting the information up into two panes again.</p>
  
  <p>This is not working as I thought, like I said I have a main_Activity that does this in the onCreate:</p>
  
  <pre><code>public void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.main_client_activity);
  }
  </code></pre>
  
  <p>with the <code>main_client_activity.xml</code> being defined in two layouts but the one for landscape tablets is here:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
     android:orientation="horizontal"
     android:layout_width="match_parent"
     android:layout_height="match_parent"&gt;
  
     &lt;fragment class="com.viciousbytes.studiotab.subactivities.ClientListView"
          android:id="@+id/client_list" android:layout_weight="1"
          android:layout_width="0px" android:layout_height="match_parent" /&gt;
  
     &lt;FrameLayout android:id="@+id/client_details" android:layout_weight="1"
          android:layout_width="0px" android:layout_height="match_parent"
          android:background="?android:attr/detailsElementBackground"/&gt;
  
  &lt;/LinearLayout&gt;
  </code></pre>
  
  <p>This all works great!  In which case I handled everything else as a full screen activity that started its own fragment:</p>
  
  <p><code>EditSessionActivity</code>
  <code>EditClientActiivyt</code>  both of which use getSupportFragmentManager().beginTransaction and I could pass information into it from the .newInstance call.  </p>
  
  <p>I had my <code>session_edit.xml</code> layout defined with buttons, textviews etc..and that was working great.  Thats what i loaded in my <code>SessionEdit</code> fragment "launched" by my <code>EditSessionActivity</code> But now since I want to split it apart I ran into a snag.  Above I defined a client_list and a client_details id, are these placeholders on my screen?  do I reference those when I wanna replace whats there with totally different fragments?</p>
  
  <p>or do i build another fragment layout called something like fragment_session_layout which defines something like:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;    
  &lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:orientation="horizontal"
    android:layout_width="match_parent"
    android:layout_height="match_parent"&gt;
  
     &lt;fragment class="com.viciousbytes.studiotab.subactivities.SessionEdit"
          android:id="@+id/session_edit" android:layout_weight="1"
          android:layout_width="0px" android:layout_height="match_parent" /&gt;
  
     &lt;FrameLayout android:id="@+id/invoice_details" android:layout_weight="1"
          android:layout_width="0px" android:layout_height="match_parent"
          android:background="?android:attr/detailsElementBackground" /&gt;
  &lt;/LinearLayout&gt;
  </code></pre>
  
  <p>Sorry don't know what to title this on the tip of my tongue of what I am asking, basically how to get two panes of fragments twice over.  THe demo online shows how to do one (and a simple ListFragment at that).</p>
  
  <p>I have done all the above and I just cannot figure out how to pass into the fragment the data I need, I was using this in my EditSessionActivity:</p>
  
  <pre><code>@Override
  public void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      int clientID = getIntent().getIntExtra(THE_SELECTED_CLIENT, -1);            
      int sessionID = getIntent().getIntExtra(SELECTED_SESSION,-1);
      SessionEdit edits = SessionEdit.newInstance(this.getBaseContext(), false, clientID, sessionID);
      mUIListener = (OnUpdateUI)edits;
      getSupportFragmentManager().beginTransaction().add(android.R.id.content, edits).commit();
  }
  </code></pre>
  
  <p>that worked, but to try to adhere to the earlier fragment example, i assumed my <code>EditSessionActivit</code>y was sorta like making another <code>MainActivity</code> (cause it has two panels in it like the main one).  so I recoded the <code>onCreate</code> in <code>EditSessionActivity</code> with this:</p>
  
  <pre><code>@Override
  public void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);      
      setContentView(R.layout.edit_session_fullview);
  }
  </code></pre>
  
  <p>Which after fighting in my EditSession fragment dealing with the onCreateView, I got this to finally work but couldn't pass in the data cause there is no instantiation of the object using like the previous <code>onCreate</code> which had the <code>edits=SessionEdit.newInstance(...)</code></p>
  
  <p>So is it good practice to be doing the other fragment layout that has two pains in it and starting that up when the right action is triggered.  Or is one supposed to replace the two already created fragments?? from my <code>main_client_activity.xml</code> somehow?</p>