How to remove a preference from PreferenceActivity?
<p>I'm using PreferenceActivity. How do I remove a preference? I cannot seem to get this to work:</p>

<pre><code>Preference p = findPreference("grok");
boolean worked = getPreferenceScreen().removePreference(p);
// worked == false.
</code></pre>

<p>So the preference is found, but the removePreference() call fails. What's the right way to do this? I'm using a preference.xml file for the keys like so:</p>

<pre><code>&lt;PreferenceScreen
    xmlns:android="http://schemas.android.com/apk/res/android"&gt;

    &lt;PreferenceCategory
        android:title="foo"&gt;

        &lt;CheckBoxPreference
            android:key="grok" /&gt;

            ...
</code></pre>

<p>Thanks</p>
