Setting CheckBoxPreference from SharedPreference
<p>I'd like to use pre-defined shared preferences to set the value of a checkBoxPreference, and to set the shared preference with the checkBoxPreference.  I tried this code, but checkboxPref always ends up being null even though I know "pre_definied_shared_prefs" exist.  </p>

<pre><code>final CheckBoxPreference checkboxPref = (CheckBoxPreference) getPreferenceManager().findPreference("pre_defined_shared_prefs");


    checkboxPref.setOnPreferenceChangeListener(new Preference.OnPreferenceChangeListener() {            
        public boolean onPreferenceChange(Preference preference, Object newValue) {
            Boolean b = (Boolean) newValue;

            Intent i = getIntent();
            Integer show_num = i.getIntExtra("show_num", -1);
            SettingsManager s = new SettingsManager();
            s.setShowNotification(show_num, b, getApplicationContext());

            return true;
        }
    });
</code></pre>

<p>Why would this be and how can I fix it?</p>
