CheckBoxPreference and dependency
<p>I've a checkbox and a ListPreference, I'd like disable/enable ListPreference by checkbox. I read a lot and I found is possible only using java (and not by xml). Is it correct? Now, after read the value of "checkboxPref" (boolean true/false) I don't how do.</p>

<pre><code>SharedPreferences prefs3 = PreferenceManager.getDefaultSharedPreferences(this);
      listener = new SharedPreferences.OnSharedPreferenceChangeListener() {
          public void onSharedPreferenceChanged(SharedPreferences prefs, String listpref) {       

              CheckboxPreference = prefs.getBoolean("checkboxPref", true);
              }   };

      prefs3.registerOnSharedPreferenceChangeListener(listener);
</code></pre>

<p>preferences.xml:</p>

<pre><code>&lt;CheckBoxPreference
                        android:title="Notifify"
                        android:defaultValue="true"
                        android:key="checkboxPref" /&gt;
            &lt;ListPreference
         android:entries="@array/numberOptions"
         android:entryValues="@array/numberValues"
         android:key="number"
         android:title="Number" /&gt;
</code></pre>
