开发者

Account preferences ListPreference does not show dialog, crashes/reboots device

开发者 https://www.devze.com 2023-02-21 22:07 出处:网络
I\'m trying to store a some prefe开发者_开发知识库rences with my custom accounts. I\'ve defined

I'm trying to store a some prefe开发者_开发知识库rences with my custom accounts. I've defined

android:accountPreferences="@xml/account_preferences"

in my authenticator.xml, and res/xml/account_preferences.xml looks like this:

<?xml version="1.0" encoding="utf-8"?>
<PreferenceScreen
  xmlns:android="http://schemas.android.com/apk/res/android">
    <PreferenceCategory
        android:title="Advanced settings">
    <ListPreference
        android:title="Marketplace"
        android:summary="Select marketplace"
        android:key="marketplaceId"
        android:defaultValue="715713"
        android:entries="@array/marketplaces"
        android:entryValues="@array/marketplaceIds"
        android:persistent="true"
    />

    </PreferenceCategory>
</PreferenceScreen>

Both arrays are defined in res/values/arrays.xml in string-array elements.

When I go to Accounts & Sync and select an account I can see the Marketplace field there, however if i select it, my device (or emulator) freezes and reboots, with no error message written to LogCat.

Any ideas for how I can get past this? Do I need to specify an intent in the preferences file?

Also, side question, if I get this to work, how do I access the preferences for one particular account programmatically?

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号