title: Fragment not showing up
body: <p>I'm having an issue where I can create a Fragment, its view appears to be created, but it doesn't show up. The fragment itself is created and any code inside runs without issue, but it is just invisible somewhere. The back button also interacts with it just fine (it "closes" it), it just doesn't physically show up on screen (only the main layout is displayed).</p>
  
  <p>From my FragmentActivity:</p>
  
  <pre><code>protected void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.activity_main_view);
  
      // some logic here that sets a button listener that calls openAddNamePane() when pressed
  }
  
  public void openAddNamePane(){
      AddNamePane addNamePane = new AddNamePane();
      FragmentManager fragmentManager = getSupportFragmentManager();
      FragmentTransaction fragmentTransaction = fragmentManager.beginTransaction();
      fragmentTransaction.replace(R.id.layout_root, addNamePane, "AddnamePane");
      fragmentTransaction.addToBackStack(null);
      fragmentTransaction.commit();
  }
  </code></pre>
  
  <p>This is the layout for the View that is first displayed (activity_main_view.xml aka my 'root layout'):</p>
  
  <pre><code>&lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
      xmlns:tools="http://schemas.android.com/tools"
      android:layout_width="match_parent"
      android:layout_height="match_parent"
  
      android:paddingBottom="@dimen/activity_vertical_margin"
      android:paddingLeft="@dimen/activity_horizontal_margin"
      android:paddingRight="@dimen/activity_horizontal_margin"
      android:paddingTop="@dimen/activity_vertical_margin"
  
      android:orientation="vertical"
  
      android:background="@color/white"
      android:id="@+id/layout_root"&gt;
  
      &lt;LinearLayout 
          android:layout_width="match_parent"
          android:layout_height="wrap_content"&gt;
  
          &lt;Button android:id="@+id/addPlayerButton"
              android:layout_width="wrap_content"
              android:layout_height="wrap_content"
              android:text="Add Player" /&gt;
  
          &lt;Button android:id="@+id/button2"
              android:layout_width="wrap_content"
              android:layout_height="wrap_content"
              android:text="@string/buttonLabel" /&gt;
      &lt;/LinearLayout&gt;
  
  
      &lt;ListView android:id="@+id/playerListView"
          android:layout_width="match_parent"
          android:layout_height="match_parent"
          android:cacheColorHint="@color/white"
          android:entries="@array/testStringArray" &gt;
      &lt;/ListView&gt;
  
  &lt;/LinearLayout&gt;
  </code></pre>
  
  <p>This is my fragment class:</p>
  
  <pre><code>public class AddNamePane extends Fragment {
      public void onCreate(Bundle savedInstanceState){
          super.onCreate(savedInstanceState);
      }
  
      public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
          System.out.println("AddNamePane.onCreateView()");
  
          View view = inflater.inflate(R.layout.add_player_pane_layout, container, false);
  
          return view;
      }
  
      // a few other methods here, onAttach(), onStop(), onPause(), etc
      // all are empty of logic with just a println to see if they are being called correctly (in which they are)
  }
  </code></pre>
  
  <p>This is the layout for that "AddNamePane" fragment:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
      android:layout_width="match_parent"
      android:layout_height="match_parent"
  
      android:paddingBottom="@dimen/activity_vertical_margin"
      android:paddingLeft="@dimen/activity_horizontal_margin"
      android:paddingRight="@dimen/activity_horizontal_margin"
      android:paddingTop="@dimen/activity_vertical_margin"
  
      android:orientation="vertical" &gt;
  
      &lt;EditText
          android:id="@+id/editText1"
          android:layout_width="match_parent"
          android:layout_height="wrap_content"
          android:ems="10" 
          android:text="test name here"
          android:hint="Name here" &gt;
          &lt;requestFocus /&gt;
      &lt;/EditText&gt;
  
      &lt;Button
          android:id="@+id/button1"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:text="Button" /&gt;
  
  &lt;/LinearLayout&gt;
  </code></pre>
  
  <p>I am pretty new to using fragments, not too sure if my issue is in code or if it is something to do with the layouts. My goal is to add the "AddNamePane" to the 'root layout' replacing the main view temporarily. What I did to attempt this was to give my root layout an id and use that in the FragmentTransaction. If it matters, the api level I am using is 8 (Android 2.2) thus using things from android.support.v4.app package.</p>