Account preferences crashes on ListPreference
<p>I have created an account type using the AccountAuthenticator stuff as done in the <code>SampleSyncAdapter</code> tutorial. I am now trying to get account preferences working.</p>

<p>I have added the line <code>android:accountPreferences="@xml/account_preferences"</code> to my <code>account-authenticator</code> and account_preferences.xml looks like so:</p>

<pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;

&lt;PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"&gt;
&lt;PreferenceCategory android:title="@string/alum_settings_title"/&gt;

&lt;CheckBoxPreference
    android:key="sync_alum"
    android:title="@string/sync_alum"
    android:summaryOn="@string/sync_alum_check"
    android:summaryOff="@string/sync_alum_nocheck"/&gt;

&lt;ListPreference
    android:key="sync_alum_since"
    android:title="@string/alum_years"
    android:entries="@array/years"
    android:entryValues="@array/years"
    android:dependency="sync_alum"/&gt;
&lt;/PreferenceScreen&gt;
</code></pre>

<p>The checkbox preference works exactly like it should but the ListPreference crashes the entire system with the following message:</p>

<pre><code>05-14 22:32:16.794: ERROR/AndroidRuntime(63): android.view.WindowManager$BadTokenException: Unable to add window -- token null is not for an application
</code></pre>

<p>I get the same error with EditTextPreference and with the custom subclass of DialogPreference I created.</p>
