title: Cant start preferenceActivity from Menu
body: <p>I have created a class called Menu. In it when the user presses the menu button, they are presented with 3 options ie. about, preferences and exit. When they click preferences, a preference acivity is supposed to be opened. However, the app is crashing and failing to open the preference activity. I have posted the ListActivity, the activity tag for the activity I am trying to open in the manifest and the logfile. Please help. </p>
  
  <pre><code>public class Menu extends ListActivity {
      String[] list = { "StartView", "FunWithText", "Email", "Camera",
              "ActivityStarter" };
  
      @Override
      protected void onListItemClick(ListView l, View v, int position, long id) {
          super.onListItemClick(l, v, position, id);
          try {
              Class myClass = Class.forName("com.thenewboston.terry."
                      + list[position]);
              Intent myIntent = new Intent(Menu.this, myClass);
              startActivity(myIntent);
  
          } catch (ClassNotFoundException e) {
              e.printStackTrace();
          }
  
      }
  
      @Override
      protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setListAdapter(new ArrayAdapter&lt;String&gt;(Menu.this,
                  android.R.layout.simple_list_item_1, list));
  
      }
  
      @Override
      public boolean onCreateOptionsMenu(android.view.Menu menu) {
  
          super.onCreateOptionsMenu(menu);
          MenuInflater balloon = getMenuInflater();
          balloon.inflate(R.menu.menu, menu);
          return true;
      }
  
      @Override
      public boolean onOptionsItemSelected(MenuItem item) {
          switch (item.getItemId()) {
          case (R.id.about):
              Intent myIntent = new Intent(Menu.this, Dialogue.class);
              startActivity(myIntent);
              break;
          case (R.id.preferences):
              Intent prefs = new Intent(Menu.this, Preferences.class);
              startActivity(prefs);
              break;
          case (R.id.exit):
              finish();
              break;
  
          }
          return false;
      }
  
  }
  </code></pre>
  
  <hr/>
  
  <p><strong>Manifest.xml:</strong></p>
  
  <pre><code>    &lt;activity
          android:name=".Preferences"
          android:label="Start Activity"
          android:theme="@android:style/Theme.Dialog" &gt;
  
  
  
          &lt;intent-filter&gt;
              &lt;action android:name="com.thenewboston.terry.PREFS" /&gt;
  
              &lt;category android:name="android.intent.category.DEFAULT" /&gt;
          &lt;/intent-filter&gt;
      &lt;/activity&gt;
  </code></pre>
  
  <p><hr/>
  <strong>Error Log:</strong></p>
  
  <pre><code>07-18 00:39:07.133: E/AndroidRuntime(738): FATAL EXCEPTION: main
  07-18 00:39:07.133: E/AndroidRuntime(738): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.thenewboston.terry/com.thenewboston.terry.Preferences}: android.view.InflateException: Binary XML file line #14: Error inflating class listPreference
  07-18 00:39:07.133: E/AndroidRuntime(738):  at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2663)
  07-18 00:39:07.133: E/AndroidRuntime(738):  at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2679)
  07-18 00:39:07.133: E/AndroidRuntime(738):  at android.app.ActivityThread.access$2300(ActivityThread.java:125)
  07-18 00:39:07.133: E/AndroidRuntime(738):  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2033)
  07-18 00:39:07.133: E/AndroidRuntime(738):  at android.os.Handler.dispatchMessage(Handler.java:99)
  07-18 00:39:07.133: E/AndroidRuntime(738):  at android.os.Looper.loop(Looper.java:123)
  07-18 00:39:07.133: E/AndroidRuntime(738):  at android.app.ActivityThread.main(ActivityThread.java:4627)
  07-18 00:39:07.133: E/AndroidRuntime(738):  at java.lang.reflect.Method.invokeNative(Native Method)
  07-18 00:39:07.133: E/AndroidRuntime(738):  at java.lang.reflect.Method.invoke(Method.java:521)
  07-18 00:39:07.133: E/AndroidRuntime(738):  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
  07-18 00:39:07.133: E/AndroidRuntime(738):  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
  07-18 00:39:07.133: E/AndroidRuntime(738):  at dalvik.system.NativeStart.main(Native Method)
  07-18 00:39:07.133: E/AndroidRuntime(738): Caused by: android.view.InflateException: Binary XML file line #14: Error inflating class listPreference
  07-18 00:39:07.133: E/AndroidRuntime(738):  at android.preference.GenericInflater.createItemFromTag(GenericInflater.java:441)
  07-18 00:39:07.133: E/AndroidRuntime(738):  at android.preference.GenericInflater.rInflate(GenericInflater.java:481)
  07-18 00:39:07.133: E/AndroidRuntime(738):  at android.preference.GenericInflater.inflate(GenericInflater.java:326)
  07-18 00:39:07.133: E/AndroidRuntime(738):  at android.preference.GenericInflater.inflate(GenericInflater.java:263)
  07-18 00:39:07.133: E/AndroidRuntime(738):  at android.preference.PreferenceManager.inflateFromResource(PreferenceManager.java:251)
  07-18 00:39:07.133: E/AndroidRuntime(738):  at android.preference.PreferenceActivity.addPreferencesFromResource(PreferenceActivity.java:262)
  07-18 00:39:07.133: E/AndroidRuntime(738):  at com.thenewboston.terry.Preferences.onCreate(Preferences.java:12)
  07-18 00:39:07.133: E/AndroidRuntime(738):  at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
  07-18 00:39:07.133: E/AndroidRuntime(738):  at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2627)
  07-18 00:39:07.133: E/AndroidRuntime(738):  ... 11 more
  07-18 00:39:07.133: E/AndroidRuntime(738): Caused by: java.lang.ClassNotFoundException: android.preference.listPreference in loader dalvik.system.PathClassLoader[/data/app/com.thenewboston.terry-1.apk]
  07-18 00:39:07.133: E/AndroidRuntime(738):  at dalvik.system.PathClassLoader.findClass(PathClassLoader.java:243)
  07-18 00:39:07.133: E/AndroidRuntime(738):  at java.lang.ClassLoader.loadClass(ClassLoader.java:573)
  07-18 00:39:07.133: E/AndroidRuntime(738):  at java.lang.ClassLoader.loadClass(ClassLoader.java:532)
  07-18 00:39:07.133: E/AndroidRuntime(738):  at android.preference.GenericInflater.createItem(GenericInflater.java:375)
  07-18 00:39:07.133: E/AndroidRuntime(738):  at android.preference.GenericInflater.onCreateItem(GenericInflater.java:417)
  07-18 00:39:07.133: E/AndroidRuntime(738):  at android.preference.GenericInflater.createItemFromTag(GenericInflater.java:428)
  07-18 00:39:07.133: E/AndroidRuntime(738):  ... 19 more
  </code></pre>
  
  <blockquote>
  <pre><code>**Preferences xml:**
  
  &lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;PreferenceScreen
    xmlns:android="http://schemas.android.com/apk/res/android"&gt;
    &lt;PreferenceCategory android:title="Label"&gt;    
      &lt;EditTextPreference 
      android:title="EditText"
      android:key="name"
      android:summary="Enter your name"/&gt;
  
      &lt;CheckBoxPreference
      android:title="checkBox"
      android:key="music"
      android:defaultValue="true"
      android:summary="music on?"
      /&gt;
      &lt;listPreference
      android:title="list"
      android:key="list"
      android:summary="Choose somethign"
      android:entries="@array/list"
      android:entryValues="@array/values"
     /&gt;
    &lt;/PreferenceCategory&gt;
   &lt;/PreferenceScreen&gt;
  </code></pre>
  </blockquote>
  
  <pre><code>public class Preferences extends PreferenceActivity {
  
      @Override
      protected void onCreate(Bundle savedInstanceState) {
  
          super.onCreate(savedInstanceState);
          addPreferencesFromResource(R.xml.prefs);
      }
  
  }
  </code></pre>