title: onPreferenceClick not working in android
body: <p>I have problem implementing Preference.
  When i run my app and click on the preference tab nothing happens.
  I don't know what is wrong with the code, Because logcat don't show anything.
  And thanks in advance.</p>
  
  <pre><code>public class Reset extends PreferenceActivity{
  
  private Preference myPreference;
  
  protected void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      myPreference = findPreference("reset");
      myPreference.setOnPreferenceClickListener(new OnPreferenceClickListener() {
  
          public boolean onPreferenceClick(Preference arg0) {
              Builder alertDialog = new AlertDialog.Builder(Reset.this);
              alertDialog.setMessage("Reset?");
              alertDialog.setCancelable(true);
              alertDialog.setPositiveButton("Yes", new DialogInterface.OnClickListener() {
                  public void onClick(DialogInterface dialog, int which) {
                      SharedPreferences settings =  PreferenceManager.getDefaultSharedPreferences(getBaseContext());                          
                      SharedPreferences.Editor editor = settings.edit();
                      editor.clear();
                      editor.commit();
                  } }); 
              alertDialog.setNegativeButton("No", new DialogInterface.OnClickListener() {
                  public void onClick(DialogInterface dialog, int which) {
                      dialog.cancel();
                  } }); 
              alertDialog.show();
              return false;
          }
      });
  
  }
  
  }
  </code></pre>
  
  <p>XML:</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;Preference android:title="Reset Score" android:key="reset"&gt;
   &lt;/Preference&gt;
   &lt;/PreferenceScreen&gt;
  </code></pre>