getPreferenceScreen()
<p>I need check a value and enable or disable programatically "checkboxpreference". I using this code but getPreferenceScreen() wants a method and I don't know which method use. (I use this on android 2.1).</p>

<pre><code>                        &lt;CheckBoxPreference
                        android:enabled="true"
                        android:title="Now"
                        android:defaultValue="false"
                        android:key="keep" /&gt;



protected void check(){

        // read values

        if (values){
getPreferenceScreen().findPreference("checkbox-preference-key").setEnabled(true);
        }
        else {
getPreferenceScreen().findPreference("checkbox-preference-key").setEnabled(false);
</code></pre>
