title: setOnPreferenceClickListener function doesn't work for Preference on Android
body: <p>I'm using the code below to print text to logcat, but the <code>setOnPreferenceClickListener</code> function doesn't catch the event.</p>
  
  <p>I'm using Android API Level 8 to test the code.</p>
  
  <pre class="lang-xml prettyprint-override"><code>&lt;PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android" &gt;
  
      &lt;CheckBoxPreference
          android:defaultValue="true"
          android:key="settings_use_cache"
          android:summary="Use cache"
          android:title="Use Cache" /&gt;
  
      &lt;Preference
          android:defaultValue="true"
          android:key="settings_delete_cache"
          android:summary="Delete all cache data"
          android:title="Clear Cache" /&gt;
  
  &lt;/PreferenceScreen&gt;
  </code></pre>
  
  <p>Here is the code</p>
  
  <pre class="lang-java prettyprint-override"><code>public static class CachePreferenceFragment extends
          PreferenceActivity {
      @Override
      public void onCreate(Bundle savedInstanceState) {
  
          Log.w("DBG", "Oncreate started");
  
          super.onCreate(savedInstanceState);
          addPreferencesFromResource(R.xml.pref_cache);
  
          Preference settings_delete_cache=findPreference("settings_delete_cache");
          settings_delete_cache.setOnPreferenceClickListener(new OnPreferenceClickListener() {
  
              @Override
              public boolean onPreferenceClick(Preference preference) {
                  Log.w("Prefence", "Deleting Cache");
                  return false;
              }
          });         
      }
  }
  </code></pre>
  
  <p>What can I do to ensure the listener catches the event?</p>