title: Android seekbarpreference and display value
body: <p>I am trying to make a cusotm SeekBarPreference and display the value of it to the user. Each time I click on Settings in the menu, my app crashes and I'm not sure why. Here is the code I have so far.</p>
  
  <p>MainActivity.java</p>
  
  <pre><code>//Within the MainActivity.java
  @Override
  public boolean onCreateOptionsMenu(Menu menu)
  {
      super.onCreateOptionsMenu(menu);
      getMenuInflater().inflate(R.menu.settings_menu, menu);
      return true;
  }
  
  @Override
  public boolean onOptionsItemSelected(MenuItem item)
  {
      switch(item.getItemId())
      {
          case R.id.preferences:
              Intent i2 = new Intent("com.example.testApp.PREFERENCES");
              startActivity(i2);
              break;
          case R.id.exit:
              finish();
              break;
      }
  
      return false;
  }
  </code></pre>
  
  <p>res/xml/preferences.xml</p>
  
  <p>Is it correct to use "com.example.testApp.SeekBarPreference" to call a new class?</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android" &gt;   
  &lt;com.example.testApp.SeekBarPreference
      android:title="Sensativity"
      android:key="seekbar"
      android:max="100"
      android:defaultValue="50"&gt;
  &lt;/SeekBarPreference&gt;
  &lt;/PreferenceScreen&gt;
  </code></pre>
  
  <p>preferences.java</p>
  
  <pre><code>public class preferences extends PreferenceActivity
  {
      @Override
      protected void onCreate(Bundle savedInstanceState)
      {
          super.onCreate(savedInstanceState);
          addPreferencesFromResource(R.xml.preferences);
      }
  }
  </code></pre>
  
  <p>SeekBarPreference.java</p>
  
  <p>I never get the log "In SBP!" since the app crashes. I left the stubs and haven't filled in the rest of the code here since I can't get to the log.</p>
  
  <pre><code>public class SeekBarPreference extends Preference implements OnSeekBarChangeListener
  {
  
      public SeekBarPreference(Context context)
      {
          super(context);
          Log.i("SBP", "In SBP!");
      }
  
      @Override
      public void onProgressChanged(SeekBar arg0, int arg1, boolean arg2) {   
      }
  
      @Override
      public void onStartTrackingTouch(SeekBar arg0) {    
      }
  
      @Override
      public void onStopTrackingTouch(SeekBar arg0) {     
      }
  }
  </code></pre>
  
  <p>Thanks.</p>