我使用AccountAuthenticator的东西创建了一个帐户类型,如在SampleSyncAdapter
教程中所做的那样。我现在试图获取帐户首选项的工作。帐户偏好在ListPreference上崩溃
我添加了这行android:accountPreferences="@xml/account_preferences"
我account-authenticator
和account_preferences.xml看起来像这样:
<?xml version="1.0" encoding="utf-8"?>
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android">
<PreferenceCategory android:title="@string/alum_settings_title"/>
<CheckBoxPreference
android:key="sync_alum"
android:title="@string/sync_alum"
android:summaryOn="@string/sync_alum_check"
android:summaryOff="@string/sync_alum_nocheck"/>
<ListPreference
android:key="sync_alum_since"
android:title="@string/alum_years"
android:entries="@array/years"
android:entryValues="@array/years"
android:dependency="sync_alum"/>
</PreferenceScreen>
复选框优先工作完全像它应该,但ListPreference崩溃,整个系统具有以下消息:
05-14 22:32:16.794: ERROR/AndroidRuntime(63): android.view.WindowManager$BadTokenException: Unable to add window -- token null is not for an application
我得到了与EditTextPreference和我创建的DialogPreference的自定义子类相同的错误。
PS。这是整个堆栈跟踪。我没有把它放在原来的文章中,试图保持可读性。 http://gist.github.com/raw/401785/73141d95ebddab0fc67b6219c38701c8d3ac7051/gistfile1.txt – Sionide21 2010-05-14 22:36:44