title: android.view.InflateException - Android app developement for dummies
body: <p>I am trying to learn some android programming with the book Android Application Developement for Dummies. One task in the book is to create an application called task reminder which introduces android fragments. According to the book the following pieces of coding should create a first simple listview:</p>
  
  <pre><code>import android.app.ListActivity;
  import android.os.Bundle;
  import android.util.Log;
  
  public class ReminderListActivity extends ListActivity {
  
  @Override
      protected void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
  
      setContentView(R.layout.reminder_list);    
      }
  
  }
  </code></pre>
  
  <p>with reminder_list looking like this:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  
  &lt;fragment xmlns:android="http://schemas.android.com/apk/res/android"
     android:name="com.holtkoe.android.birthdaytimer.ReminderListFragment"
     android:layout_width="fill_parent"
     android:layout_height="fill_parent" /&gt;
  </code></pre>
  
  <p>The class ReminderListFragment is the following:</p>
  
  <pre><code>import android.os.Bundle;
  import android.support.v4.app.ListFragment;
  import android.widget.ArrayAdapter;
  import android.widget.ListAdapter;
  
  public class ReminderListFragment extends ListFragment {
  
     private ListAdapter mAdapter;
  
      @Override
      public void onActivityCreated(Bundle savedInstanceState){
          super.onActivityCreated(savedInstanceState);
  
          String[] items = new String[] {"Foo","Bar","Fizz","Bin"};
  
          mAdapter = new ArrayAdapter&lt;String&gt;(getActivity(), R.layout.reminder_row,  R.id.text1, items);
          setListAdapter(mAdapter);
  
       }
    }
  </code></pre>
  
  <p>and finally reminder_row:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;TextView 
      android:id="@+id/text1"
      xmlns:android="http://schemas.android.com/apk/res/android"    
      android:layout_width="match_parent"
      android:layout_height="match_parent"
      android:padding="10dp"/&gt;
  </code></pre>
  
  <p>I tried to run this on both an emulated device and on my smartphone but always get the following </p>
  
  <pre><code>09-26 22:44:53.270: D/AndroidRuntime(2493): Shutting down VM
  09-26 22:44:53.270: W/dalvikvm(2493): threadid=1: thread exiting with uncaught   exception (group=0x412d8930)
  09-26 22:44:53.290: E/AndroidRuntime(2493): FATAL EXCEPTION: main
  09-26 22:44:53.290: E/AndroidRuntime(2493): java.lang.RuntimeException: Unable to  start activity   ComponentInfo{com.holtkoe.android.birthdaytimer/com.holtkoe.android.birthdaytimer.ReminderListActivity}: android.view.InflateException: Binary XML file line #3: Error inflating class fragment
  09-26 22:44:53.290: E/AndroidRuntime(2493):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2245)
  09-26 22:44:53.290: E/AndroidRuntime(2493):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2299)
  09-26 22:44:53.290: E/AndroidRuntime(2493):     at android.app.ActivityThread.access$700(ActivityThread.java:150)
  09-26 22:44:53.290: E/AndroidRuntime(2493):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1280)
  09-26 22:44:53.290: E/AndroidRuntime(2493):     at android.os.Handler.dispatchMessage(Handler.java:99)
  09-26 22:44:53.290: E/AndroidRuntime(2493):     at android.os.Looper.loop(Looper.java:137)
  09-26 22:44:53.290: E/AndroidRuntime(2493):     at android.app.ActivityThread.main(ActivityThread.java:5283)  
  09-26 22:44:53.290: E/AndroidRuntime(2493):     at java.lang.reflect.Method.invokeNative(Native Method)
  09-26 22:44:53.290: E/AndroidRuntime(2493):     at java.lang.reflect.Method.invoke(Method.java:511)
  09-26 22:44:53.290: E/AndroidRuntime(2493):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1102)
  09-26 22:44:53.290: E/AndroidRuntime(2493):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:869)
  09-26 22:44:53.290: E/AndroidRuntime(2493):     at dalvik.system.NativeStart.main(Native Method)
  09-26 22:44:53.290: E/AndroidRuntime(2493): Caused by: android.view.InflateException: Binary XML file line #3: Error inflating class fragment
  09-26 22:44:53.290: E/AndroidRuntime(2493):     at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:710)
  09-26 22:44:53.290: E/AndroidRuntime(2493):     at android.view.LayoutInflater.inflate(LayoutInflater.java:467)
  09-26 22:44:53.290: E/AndroidRuntime(2493):     at android.view.LayoutInflater.inflate(LayoutInflater.java:397)
  09-26 22:44:53.290: E/AndroidRuntime(2493):     at android.view.LayoutInflater.inflate(LayoutInflater.java:353)
  09-26 22:44:53.290: E/AndroidRuntime(2493):     at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:364)
  09-26 22:44:53.290: E/AndroidRuntime(2493):     at android.app.Activity.setContentView(Activity.java:1930)
  09-26 22:44:53.290: E/AndroidRuntime(2493):     at com.holtkoe.android.birthdaytimer.ReminderListActivity.onCreate(ReminderListActivity.java:14)
  09-26 22:44:53.290: E/AndroidRuntime(2493):     at android.app.Activity.performCreate(Activity.java:5283)
  09-26 22:44:53.290: E/AndroidRuntime(2493):     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1097)   
  09-26 22:44:53.290: E/AndroidRuntime(2493):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2209)
  09-26 22:44:53.290: E/AndroidRuntime(2493):     ... 11 more
  09-26 22:44:53.290: E/AndroidRuntime(2493): Caused by: android.app.Fragment$InstantiationException: Trying to instantiate a class com.holtkoe.android.birthdaytimer.ReminderListFragment that is not a Fragment
  09-26 22:44:53.290: E/AndroidRuntime(2493):     at android.app.Fragment.instantiate(Fragment.java:584)
  09-26 22:44:53.290: E/AndroidRuntime(2493):     at android.app.Fragment.instantiate(Fragment.java:560)
  09-26 22:44:53.290: E/AndroidRuntime(2493):     at android.app.Activity.onCreateView(Activity.java:4864)
  09-26 22:44:53.290: E/AndroidRuntime(2493):     at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:686)
  09-26 22:44:53.290: E/AndroidRuntime(2493):     ... 20 more
  09-26 22:44:53.290: E/AndroidRuntime(2493): Caused by: java.lang.ClassCastException
  09-26 22:44:53.290: E/AndroidRuntime(2493):     ... 24 more
  </code></pre>
  
  <p>To be honest I am lost (and obviously not even a dummy)...I read the Android Developer Reference for fragments and the example given there looked quite similar to what was written in the book, however, for some reason there is an inflation problem.</p>
  
  <p>I am very grateful for any help! Thanks, guys!</p>