Custom EditTextPreference and setOnPreferenceChangeListener not called
<p>My listener is not getting called for some reason? This is what I have:</p>

<p>In Preference file I have a custom EditTextPreference:</p>

<pre><code>    &lt;com.xxx.yyy.preference.PreferenceEditTextDialog
        android:layout="@layout/preference_edit"
        android:title="@string/title"
        android:summary="@string/summary"
        android:defaultValue=""
        android:dialogTitle="@string/dialogTitle"
        android:key="mypref"/&gt;
</code></pre>

<p>I extend my class:</p>

<pre><code>public class PreferenceEditTextDialog extends EditTextPreference {
</code></pre>

<p>Launching my Activity:</p>

<pre><code>startActivity(new Intent(this, PrefsActivity.class));
</code></pre>

<p>Definition:</p>

<pre><code>public class PrefsActivity extends PreferenceActivity implements   
OnPreferenceClickListener, OnSharedPreferenceChangeListener {
</code></pre>

<p>In here I register my setOnPreferenceChangeListener (which is not called).</p>

<p>However changing my Preference file from:</p>

<pre><code>&lt;com.xxx.yyy.preference.PreferenceEditTextDialog 
</code></pre>

<p>to default:</p>

<pre><code>&lt;EditTextPreference 
</code></pre>

<p>it all works. Could someone help me to find the problem, somehow the listener is not propagated properly using my custom Preference.</p>

<p>Thanks!</p>

<p>@Sam Here my listener definition:</p>

<pre><code>    myfield = (EditTextPreference) getPreferenceScreen().findPreference(KEY_PREFERENCE);
    myfield.setOnPreferenceChangeListener(new OnPreferenceChangeListener() {

        @Override
        public boolean onPreferenceChange(Preference preference, Object newValue) {
            Boolean valid = true;
        if(!validate(newValue.toString())) {
               valid = false;
            }
            return valid;
        }
    });
</code></pre>
