title: RuntimeException: Error inflating class fragment
body: <p>I am getting a runtimeException with the following code, does anyone know why?</p>
  
  <pre><code>public class FragsApplicationActivity 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>SuggestionFrags class</p>
  
  <pre><code>public class SuggestionFrags extends Fragment{
      @Override
      public View onCreateView(LayoutInflater inflater, ViewGroup container,
              Bundle savedInstanceState) {
          // TODO Auto-generated method stub
          return super.onCreateView(inflater, container, savedInstanceState);
      }
  
  }
  </code></pre>
  
  <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;fragment
          android:id="@+id/fragment1"
          android:layout_width="match_parent"
          android:layout_height="wrap_content"
          class="com.samplefragsapplication.SuggestionFrags" /&gt;
  
  &lt;/LinearLayout&gt;
  </code></pre>
  
  <p>I am getting this exception:</p>
  
  <pre><code>11-23 18:09:23.899: E/AndroidRuntime(2436): FATAL EXCEPTION: main
  11-23 18:09:23.899: E/AndroidRuntime(2436): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.samplefragsapplication/com.samplefragsapplication.FragsApplicationActivity}: android.view.InflateException: Binary XML file line #2: Error inflating class fragment
  11-23 18:09:23.899: E/AndroidRuntime(2436):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2663)
  11-23 18:09:23.899: E/AndroidRuntime(2436):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2679)
  11-23 18:09:23.899: E/AndroidRuntime(2436):     at android.app.ActivityThread.access$2300(ActivityThread.java:125)
  11-23 18:09:23.899: E/AndroidRuntime(2436):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2033)
  11-23 18:09:23.899: E/AndroidRuntime(2436):     at android.os.Handler.dispatchMessage(Handler.java:99)
  11-23 18:09:23.899: E/AndroidRuntime(2436):     at android.os.Looper.loop(Looper.java:123)
  11-23 18:09:23.899: E/AndroidRuntime(2436):     at android.app.ActivityThread.main(ActivityThread.java:4627)
  11-23 18:09:23.899: E/AndroidRuntime(2436):     at java.lang.reflect.Method.invokeNative(Native Method)
  11-23 18:09:23.899: E/AndroidRuntime(2436):     at java.lang.reflect.Method.invoke(Method.java:521)
  11-23 18:09:23.899: E/AndroidRuntime(2436):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
  11-23 18:09:23.899: E/AndroidRuntime(2436):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
  11-23 18:09:23.899: E/AndroidRuntime(2436):     at dalvik.system.NativeStart.main(Native Method)
  11-23 18:09:23.899: E/AndroidRuntime(2436): Caused by: android.view.InflateException: Binary XML file line #2: Error inflating class fragment
  11-23 18:09:23.899: E/AndroidRuntime(2436):     at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:576)
  11-23 18:09:23.899: E/AndroidRuntime(2436):     at android.view.LayoutInflater.inflate(LayoutInflater.java:385)
  11-23 18:09:23.899: E/AndroidRuntime(2436):     at android.view.LayoutInflater.inflate(LayoutInflater.java:320)
  11-23 18:09:23.899: E/AndroidRuntime(2436):     at android.view.LayoutInflater.inflate(LayoutInflater.java:276)
  11-23 18:09:23.899: E/AndroidRuntime(2436):     at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:198)
  11-23 18:09:23.899: E/AndroidRuntime(2436):     at android.app.Activity.setContentView(Activity.java:1647)
  11-23 18:09:23.899: E/AndroidRuntime(2436):     at com.samplefragsapplication.FragsApplicationActivity.onCreate(FragsApplicationActivity.java:12)
  11-23 18:09:23.899: E/AndroidRuntime(2436):     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
  11-23 18:09:23.899: E/AndroidRuntime(2436):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2627)
  11-23 18:09:23.899: E/AndroidRuntime(2436): Caused by: java.lang.ClassNotFoundException: android.view.fragment in loader dalvik.system.PathClassLoader[/data/app/com.samplefragsapplication-2.apk]
  11-23 18:09:23.899: E/AndroidRuntime(2436):     at dalvik.system.PathClassLoader.findClass(PathClassLoader.java:243)
  11-23 18:09:23.899: E/AndroidRuntime(2436):     at java.lang.ClassLoader.loadClass(ClassLoader.java:573)
  11-23 18:09:23.899: E/AndroidRuntime(2436):     at java.lang.ClassLoader.loadClass(ClassLoader.java:532)
  11-23 18:09:23.899: E/AndroidRuntime(2436):     at android.view.LayoutInflater.createView(LayoutInflater.java:466)
  11-23 18:09:23.899: E/AndroidRuntime(2436):     at android.view.LayoutInflater.onCreateView(LayoutInflater.java:544)
  11-23 18:09:23.899: E/AndroidRuntime(2436):     at com.android.internal.policy.impl.PhoneLayoutInflater.onCreateView(PhoneLayoutInflater.java:66)
  11-23 18:09:23.899: E/AndroidRuntime(2436):     at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:563)
  </code></pre>