title: Unable to start activity ComponentInfo android.view.InflateException: Binary XML file line #6: Error inflating class fragment using ListFragment
body: <p>I am new in Android and trying to make simple App .Im trying to display array list under Fragments . This list keep updated as it is driven by XML data from website . SInce array list is dynamic Im using onActivityCreated rather then onCreateView .
  Below are my code </p>
  
  <pre><code>package com.example.myearthquake;
  
  public class EarthquakeListFragment extends ListFragment {
  
    ArrayAdapter&lt;Quake&gt; aa;
    ArrayList&lt;Quake&gt; earthquakes = new ArrayList&lt;Quake&gt;();
  
    @Override
    public void onActivityCreated(Bundle savedInstanceState) {
      super.onActivityCreated(savedInstanceState);
  
      int layoutID = android.R.layout.simple_list_item_1;
      aa = new ArrayAdapter&lt;Quake&gt;(getActivity(), layoutID , earthquakes);
      setListAdapter(aa);
      Log.d("EarthQuake","onActivityCreated");
            }
  </code></pre>
  
  <p>MainActivity Class </p>
  
  <pre><code>public class Earthquake extends Activity {
  @Override
  protected void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.activity_main);
      Log.d("EarthQuake","Activity");
  }
  </code></pre>
  
  <p>Layout </p>
  
  <pre><code>   &lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
     android:orientation="vertical"
    android:layout_width="match_parent"
    android:layout_height="match_parent"&gt;
   &lt;fragment android:name="com.paad.myearthquake.EarthquakeListFragment"
   android:id="@+id/EarthquakeListFragment"
   android:layout_width="match_parent" 
   android:layout_height="match_parent" 
   /&gt;
    &lt;/LinearLayout&gt;
  </code></pre>
  
  <p>Error</p>
  
  <pre><code>    01-26 16:12:12.865: D/AndroidRuntime(1480): Shutting down VM
      01-26 16:12:12.865: W/dalvikvm(1480): threadid=1: thread exiting with uncaught       exception (group=0x41465700)
      01-26 16:12:12.906: E/AndroidRuntime(1480): FATAL EXCEPTION: main
      01-26 16:12:12.906: E/AndroidRuntime(1480): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.myearthquake/com.example.myearthquake.Earthquake}: android.view.InflateException: Binary XML file line #6: Error inflating class fragment
      01-26 16:12:12.906: E/AndroidRuntime(1480):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2211)
      01-26 16:12:12.906: E/AndroidRuntime(1480):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2261)
      01-26 16:12:12.906: E/AndroidRuntime(1480):     at android.app.ActivityThread.access$600(ActivityThread.java:141)
      01-26 16:12:12.906: E/AndroidRuntime(1480):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1256)
      01-26 16:12:12.906: E/AndroidRuntime(1480):     at android.os.Handler.dispatchMessage(Handler.java:99)
      01-26 16:12:12.906: E/AndroidRuntime(1480):     at android.os.Looper.loop(Looper.java:137)
      01-26 16:12:12.906: E/AndroidRuntime(1480):     at android.app.ActivityThread.main(ActivityThread.java:5103)
      01-26 16:12:12.906: E/AndroidRuntime(1480):     at java.lang.reflect.Method.invokeNative(Native Method)
      01-26 16:12:12.906: E/AndroidRuntime(1480):     at java.lang.reflect.Method.invoke(Method.java:525)
      01-26 16:12:12.906: E/AndroidRuntime(1480):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:737)
      01-26 16:12:12.906: E/AndroidRuntime(1480):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
      01-26 16:12:12.906: E/AndroidRuntime(1480):     at dalvik.system.NativeStart.main(Native Method)
      01-26 16:12:12.906: E/AndroidRuntime(1480): Caused by: android.view.InflateException: Binary XML file line #6: Error inflating class fragment
      01-26 16:12:12.906: E/AndroidRuntime(1480):     at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:713)
      01-26 16:12:12.906: E/AndroidRuntime(1480):     at android.view.LayoutInflater.rInflate(LayoutInflater.java:755)
      01-26 16:12:12.906: E/AndroidRuntime(1480):     at android.view.LayoutInflater.inflate(LayoutInflater.java:492)
      01-26 16:12:12.906: E/AndroidRuntime(1480):     at android.view.LayoutInflater.inflate(LayoutInflater.java:397)
      01-26 16:12:12.906: E/AndroidRuntime(1480):     at android.view.LayoutInflater.inflate(LayoutInflater.java:353)
      01-26 16:12:12.906: E/AndroidRuntime(1480):     at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:267)
      01-26 16:12:12.906: E/AndroidRuntime(1480):     at android.app.Activity.setContentView(Activity.java:1895)
      01-26 16:12:12.906: E/AndroidRuntime(1480):     at com.example.myearthquake.Earthquake.onCreate(Earthquake.java:13)
      01-26 16:12:12.906: E/AndroidRuntime(1480):     at android.app.Activity.performCreate(Activity.java:5133)
      01-26 16:12:12.906: E/AndroidRuntime(1480):     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1087)
      01-26 16:12:12.906: E/AndroidRuntime(1480):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2175)
      01-26 16:12:12.906: E/AndroidRuntime(1480):     ... 11 more
      01-26 16:12:12.906: E/AndroidRuntime(1480): Caused by: android.app.Fragment$InstantiationException: Unable to instantiate fragment com.paad.myearthquake.EarthquakeListFragment: make sure class name exists, is public, and has an empty constructor that is public
      01-26 16:12:12.906: E/AndroidRuntime(1480):     at android.app.Fragment.instantiate(Fragment.java:592)
      01-26 16:12:12.906: E/AndroidRuntime(1480):     at android.app.Fragment.instantiate(Fragment.java:560)
      01-26 16:12:12.906: E/AndroidRuntime(1480):     at android.app.Activity.onCreateView(Activity.java:4738)
      01-26 16:12:12.906: E/AndroidRuntime(1480):     at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:689)
      01-26 16:12:12.906: E/AndroidRuntime(1480):     ... 21 more
      01-26 16:12:12.906: E/AndroidRuntime(1480): Caused by: java.lang.ClassNotFoundException: Didn't find class "com.paad.myearthquake.EarthquakeListFragment" on path: DexPathList[[zip file "/data/app/com.example.myearthquake-2.apk"],nativeLibraryDirectories=[/data/app-lib/com.example.myearthquake-2, /system/lib]]
      01-26 16:12:12.906: E/AndroidRuntime(1480):     at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:53)
      01-26 16:12:12.906: E/AndroidRuntime(1480):     at java.lang.ClassLoader.loadClass(ClassLoader.java:501)
      01-26 16:12:12.906: E/AndroidRuntime(1480):     at java.lang.ClassLoader.loadClass(ClassLoader.java:461)
      01-26 16:12:12.906: E/AndroidRuntime(1480):     at android.app.Fragment.instantiate(Fragment.java:582)
      01-26 16:12:12.906: E/AndroidRuntime(1480):     ... 24 more
      01-26 16:17:13.400: I/Process(1480): Sending signal. PID: 1480 SIG: 9
  </code></pre>