Android:EditTextPreference将字符串转换为数字
我有一个带有EditTextPreference的简单PreferenceActivity。 我的问题是,我将默认文本设置为电话号码(例如+14047771000) 但是,当单击首选项时,它将显示为双精度(在上面的示例中为-1.404771E10)。如何防止这种情况发生并将文本显示为字符串? 谢谢,乔尔 编辑:以下是xml:Android:EditTextPreference将字符串转换为数字,android,android-edittext,preferenceactivity,Android,Android Edittext,Preferenceactivity,我有一个带有EditTextPreference的简单PreferenceActivity。 我的问题是,我将默认文本设置为电话号码(例如+14047771000) 但是,当单击首选项时,它将显示为双精度(在上面的示例中为-1.404771E10)。如何防止这种情况发生并将文本显示为字符串? 谢谢,乔尔 编辑:以下是xml: <PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android" androi
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android" android:title="IMS Preferences">
<PreferenceCategory android:title="Sip User">
<EditTextPreference android:key="PublicId"
android:title="Public ID" android:defaultValue="+14047771000"/>
</PreferenceCategory>
</PreferenceScreen>
编辑:
任何人有什么想法吗?您可以/需要在xml声明中设置文本类型。例如
显示为双精度是什么意思?向我们展示您的xmlHint:您应该能够编辑原始问题,将xml片段与格式结合起来。