title: Fragment does not show after inflating [Fixed, but...]
body: <p>I'm trying to create a music player that will be visible in all my activities. To do this, I'm going to use a <code>Fragment</code> as some of you advised me earlier.</p>
  
  <p>Since I have no experience with <code>Fragments</code> whatsoever, I decided to implement a fragment in a "filler" activity first. 
  I created a simple fragment containing only a button and some text, and try to inflate that in my filler activity.</p>
  
  <p>However, after inflating this fragment does not show up. A message does get printed to LogCat telling me that the fragment has been inflating.</p>
  
  <p>I'm pretty sure I'm missing something, but since I have no experience with this and I couldn't find a tutorial that quite explained how to do this, I don't know what it is that I'm missing.</p>
  
  <p><strong>Music player Fragment</strong></p>
  
  <pre><code>public class AppMusicPlayer extends Fragment{
  
  
       @Override
          public View onCreateView(LayoutInflater inflater, ViewGroup container,
                                   Bundle savedInstanceState) {
              // Inflate the layout for this fragment
           System.out.println("fragment added");
              return inflater.inflate(R.layout.musicplayer_main, container, false);
          }
  
  
  }
  </code></pre>
  
  <p><strong>Music Player layout</strong></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="fill_parent"
      android:layout_height="wrap_content"
      android:orientation="vertical" &gt;
  
  
      &lt;Button
          android:id="@+id/button1"
          android:layout_width="match_parent"
          android:layout_height="wrap_content"
          android:text="Button" /&gt;
  
      &lt;TextView
          android:id="@+id/textView1"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:text="This is the fragment you're looking for" /&gt;
  
  &lt;/LinearLayout&gt;
  </code></pre>
  
  <p><strong>Filler Activity</strong></p>
  
  <pre><code>public class Filler extends FragmentActivity {
  
      @Override
      public void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.filler);
  
          Button b = (Button) findViewById(R.id.terug);
          b.setOnClickListener(new View.OnClickListener() {
              public void onClick(View arg0) {
                  Intent intent = new Intent();
                  setResult(RESULT_OK, intent);
                  finish();
              }
          });
  
      }
  
  }
  </code></pre>
  
  <p><strong>Filler layout</strong></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:orientation="vertical" &gt;
  &lt;!-- Title bar --&gt;
      &lt;RelativeLayout
          android:id="@+id/linearLayout1"
          android:layout_width="fill_parent"
          android:layout_height="wrap_content"
          android:adjustViewBounds="true"
          android:background="@drawable/title_bar" &gt;
  
          &lt;TextView
              android:id="@+id/fillertitle"
              android:layout_width="wrap_content"
              android:layout_height="wrap_content"
              android:layout_centerHorizontal="true"
              android:layout_centerVertical="true"
              android:text="Work In Progress"
              android:textAppearance="?android:attr/textAppearanceLarge"
              android:textStyle="bold" &gt;
          &lt;/TextView&gt;
  
          &lt;Button
              android:id="@+id/terug"
              android:layout_width="wrap_content"
              android:layout_height="wrap_content"
              android:layout_alignParentLeft="true"
              android:layout_alignParentTop="true"
              android:layout_centerVertical="true"
              android:background="@drawable/button_back"
              android:text="Back"
              android:textColor="#FFFFFFFF"
              android:textStyle="bold" &gt;
          &lt;/Button&gt;
      &lt;/RelativeLayout&gt;
  &lt;!-- End of title bar --&gt;
      &lt;TextView
          android:id="@+id/wip"
          android:layout_width="match_parent"
          android:layout_height="wrap_content"
          android:text="This section of the app has not been made yet. Work in progress." &gt;
      &lt;/TextView&gt;
  
      &lt;fragment
          android:id="@+id/musicPlayerFragment"
          android:layout_width="0dp"
          android:layout_height="wrap_content"
          android:layout_weight="1"
          android:name="com.mobowski.app.player.AppMusicPlayer" /&gt;
  
  &lt;/LinearLayout&gt;
  </code></pre>
  
  <p>Obviously I'm doing something wrong, but what?</p>
  
  <p><strong>Note:</strong> I'm using Android 2.3 with the Compatibility library.</p>
  
  <p>Any help is appreciated</p>
  
  <hr>
  
  <p>The problem has been fixed with the help of Yashwanth Kumar and blessenm. One gave an XML solution, the other a programmatic solution. Now I'm just wondering which solution is the most desirable one. Are there any concessions to be made with either of the solutions, or does it all boil down to the programmer's preferred solution?</p>