title: Android Setting ChangeListener to Preference
body: <p>I am trying to open a dialog when a preference is clicked. The result. It does nothing.
  Here is the Preference Activity</p>
  
  <pre><code>public class SettingsPrefActivity extends PreferenceActivity {
      ...
      Preference.OnPreferenceChangeListener changeInfoListener = new Preference.OnPreferenceChangeListener() {
          public boolean onPreferenceChange(Preference preference, Object newValue) {
              Log.i("TAG","Click in Pref");
              dialogCustom(findViewById(android.R.id.content));
              return true;
          }
      };
  
      Preference prefInfo = (Preference) findPreference("pref_info");
      prefInfo.setOnPreferenceChangeListener(changeInfoListener);
  
  }   
  
  public void dialogCustom(View v) {
      Log.i("TAG","Dialog");
      final Dialog dialog = new Dialog(getApplicationContext());
      dialog.setContentView(R.layout.dialog_info);
      dialog.setTitle("INFORMATION");
      dialog.setCancelable(true);
      Button button = (Button) dialog.findViewById(R.id.buttonOK);
      button.setOnClickListener(new View.OnClickListener() {
         public void onClick(View v) {
             dialog.dismiss();
             }
         });
         dialog.show();
  }
  </code></pre>
  
  <p>Here is part of the pref xml</p>
  
  <pre><code>&lt;PreferenceCategory 
      android:title="ABOUT"
      android:key="about_category"
      android:layout="@layout/prefcatcustomlayout"
      &gt;
     &lt;Preference
         android:key="pref_version"
         android:title="Version"
         android:summary="1.0"
     /&gt;
     &lt;Preference
         android:key="pref_info"
         android:title="Information"
         android:summary=""
     /&gt;
  &lt;/PreferenceCategory&gt;
  </code></pre>