title: Android fragment is not showing up
body: <p>I have the following codes in my android application:</p>
  
  <p>main.xml :</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="fill_parent"
  android:orientation="vertical" &gt;
  
  &lt;TextView
      android:layout_width="fill_parent"
      android:layout_height="wrap_content"
      android:text="activity" /&gt;
  
  &lt;fragment
      android:id="@+id/list"
      android:name="com.hugo.test.FragmentA"
      android:layout_width="0dp"
      android:layout_height="match_parent"
      android:layout_weight="1" /&gt;
  
  &lt;/LinearLayout&gt;
  </code></pre>
  
  <p>fragmenta.xml :</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="fill_parent"
  android:orientation="vertical" &gt;
  
  &lt;TextView
      android:layout_width="fill_parent"
      android:layout_height="wrap_content"
      android:text="helloA" /&gt;
  
  &lt;/LinearLayout&gt;
  </code></pre>
  
  <p>FragmentA.java :</p>
  
  <pre><code>package com.hugo.test;
  
  //some imports here
  
  public class FragmentA extends Fragment {
      /** Called when the activity is first created. */
      @Override
      public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) 
      {
          //super.onCreate(savedInstanceState);
          //setContentView(R.layout.main);
  
          return inflater.inflate(R.layout.fragmenta, container, false);
      }
  }
  </code></pre>
  
  <p>FragmentActivity.java :</p>
  
  <pre><code>    package com.hugo.test;
  
      //some imports here
  
  public class FragmentActivity extends Activity {
      /** Called when the activity is first created. */
      @Override
      public void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.main);
      }
  }
  </code></pre>
  
  <p>The layout of the activity should display "activity" and the fragment should display "helloA". When I run my project I only see "activity", so it seems to me that the fragment is ignored at all.</p>
  
  <p>The error I see is :</p>
  
  <pre><code>12-19 09:01:05.370: E/AndroidRuntime(1352): FATAL EXCEPTION: main
  12-19 09:01:05.370: E/AndroidRuntime(1352): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.hugo.test/com.hugo.test.FragmentActivity}: android.view.InflateException: Binary XML file line #12: Error inflating class fragment
  12-19 09:01:05.370: E/AndroidRuntime(1352):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1751)
  12-19 09:01:05.370: E/AndroidRuntime(1352):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1767)
  12-19 09:01:05.370: E/AndroidRuntime(1352):     at android.app.ActivityThread.access$1500(ActivityThread.java:122)
  12-19 09:01:05.370: E/AndroidRuntime(1352):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1005)
  12-19 09:01:05.370: E/AndroidRuntime(1352):     at android.os.Handler.dispatchMessage(Handler.java:99)
  12-19 09:01:05.370: E/AndroidRuntime(1352):     at android.os.Looper.loop(Looper.java:132)
  12-19 09:01:05.370: E/AndroidRuntime(1352):     at android.app.ActivityThread.main(ActivityThread.java:4028)
  12-19 09:01:05.370: E/AndroidRuntime(1352):     at java.lang.reflect.Method.invokeNative(Native Method)
  12-19 09:01:05.370: E/AndroidRuntime(1352):     at java.lang.reflect.Method.invoke(Method.java:491)
  12-19 09:01:05.370: E/AndroidRuntime(1352):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:844)
  12-19 09:01:05.370: E/AndroidRuntime(1352):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:602)
  12-19 09:01:05.370: E/AndroidRuntime(1352):     at dalvik.system.NativeStart.main(Native Method)
  12-19 09:01:05.370: E/AndroidRuntime(1352): Caused by: android.view.InflateException: Binary XML file line #12: Error inflating class fragment
  12-19 09:01:05.370: E/AndroidRuntime(1352):     at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:688)
  12-19 09:01:05.370: E/AndroidRuntime(1352):     at android.view.LayoutInflater.rInflate(LayoutInflater.java:724)
  12-19 09:01:05.370: E/AndroidRuntime(1352):     at android.view.LayoutInflater.inflate(LayoutInflater.java:479)
  12-19 09:01:05.370: E/AndroidRuntime(1352):     at android.view.LayoutInflater.inflate(LayoutInflater.java:391)
  12-19 09:01:05.370: E/AndroidRuntime(1352):     at android.view.LayoutInflater.inflate(LayoutInflater.java:347)
  12-19 09:01:05.370: E/AndroidRuntime(1352):     at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:245)
  12-19 09:01:05.370: E/AndroidRuntime(1352):     at android.app.Activity.setContentView(Activity.java:1780)
  12-19 09:01:05.370: E/AndroidRuntime(1352):     at com.hugo.test.FragmentActivity.onCreate(FragmentActivity.java:11)
  12-19 09:01:05.370: E/AndroidRuntime(1352):     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1048)
  12-19 09:01:05.370: E/AndroidRuntime(1352):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1715)
  12-19 09:01:05.370: E/AndroidRuntime(1352):     ... 11 more
  12-19 09:01:05.370: E/AndroidRuntime(1352): Caused by: android.app.Fragment$InstantiationException: Unable to instantiate fragment com.hugo.test.fragmenta: make sure class name exists, is public, and has an empty constructor that is public
  12-19 09:01:05.370: E/AndroidRuntime(1352):     at android.app.Fragment.instantiate(Fragment.java:500)
  12-19 09:01:05.370: E/AndroidRuntime(1352):     at android.app.Fragment.instantiate(Fragment.java:468)
  12-19 09:01:05.370: E/AndroidRuntime(1352):     at android.app.Activity.onCreateView(Activity.java:4132)
  12-19 09:01:05.370: E/AndroidRuntime(1352):     at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:664)
  12-19 09:01:05.370: E/AndroidRuntime(1352):     ... 20 more
  12-19 09:01:05.370: E/AndroidRuntime(1352): Caused by: java.lang.ClassNotFoundException: com.hugo.test.fragmenta in loader dalvik.system.PathClassLoader[/data/app/com.jochen.test-1.apk]
  12-19 09:01:05.370: E/AndroidRuntime(1352):     at dalvik.system.PathClassLoader.findClass(PathClassLoader.java:251)
  12-19 09:01:05.370: E/AndroidRuntime(1352):     at java.lang.ClassLoader.loadClass(ClassLoader.java:540)
  12-19 09:01:05.370: E/AndroidRuntime(1352):     at java.lang.ClassLoader.loadClass(ClassLoader.java:500)
  12-19 09:01:05.370: E/AndroidRuntime(1352):     at android.app.Fragment.instantiate(Fragment.java:490)
  12-19 09:01:05.370: E/AndroidRuntime(1352):     ... 23 more
  </code></pre>
  
  <p>Because of that error I added a constructor to FragmentA.java </p>
  
  <pre><code>public FragmentA()
  {
  
  }
  </code></pre>
  
  <p>This error is not gone, the fragment still doesn't show up, same behavior as before. Anyone an idea?</p>