列表首选项将返回条目,而不是EntryValues

|| 我在“首选项活动”中创建了一个“列表首选项”,代码为所选项目返回的值是Entry的值,而不是EntryValues的值。 例: 参赛作品:David New 值:DAVIDNEW.TTF 该代码返回\“ David New \”而不是\“ DAVIDNEW.TTF \”。 这是代码: 文件
preferences.xml
<ListPreference
            android:key=\"fontSelect\"
            android:title=\"@string/textPrefs\"
            android:summary=\"@string/textPrefs\"
            android:defaultValue=\"DAVIDNEW.TTF\"
            android:entries=\"@array/fonts\"
            android:entryValues=\"@array/fontsValues\" />
文件
arrays.xml
<string-array name=\"fonts\">
    <item>Alex</item>
    <item>Cardo</item>
    <item>Chaya</item>
    <item>David New</item>
    <item>Droid Sans</item>
    <item>Frank</item>
    <item>Mike Hebrew</item>
</string-array>
<string-array name=\"fontsValues\">
    <item>ALEX.TTF</item>
    <item>Cardo99s.ttf</item>
    <item>CHAYA.TTF</item>
    <item>DAVIDNEW.TTF</item>
    <item>DroidSansHebrew.ttf</item>
    <item>frank.ttf</item>
    <item>mike_hebrew_regular_v33.ttf</item>
</string-array>
文件
reader.java
String f1 = new String(myprefs.getString(\"fontSelect\", \"DAVIDNEW.TTF\"));
font = Typeface.createFromAsset(getAssets(), f1);
tv.setTypeface(font);
f1
的值为\“ David New \”而不是\“ DAVIDNEW.TTF \”。     
已邀请:

要回复问题请先登录注册