如何将值保存为来自 EditTextPreference 的浮点数?
我遵循这个PreferenceActivity: save value as integer 但我没有为我工作。我的偏好文件是
<?xml version="1.0" encoding="utf-8"?>
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android">
<PreferenceCategory
android:title="Taxes"
android:key="first_category">
<CheckBoxPreference
android:key="include_taxes"
android:summary="Include or Exclude taxes"
android:title="Include Taxes"
android:defaultValue="true"
/>
<PreferenceScreen
android:key="Entering_Taxes"
android:title="Enter the Values"
android:dependency="include_taxes"
android:persistent="false">
<EditTextPreference
android:key="ED_tax"
android:title="E.D Tax"
android:summary="Define E.D Tax"
android:dialogTitle="Set E.D Tax"
android:dialogMessage="Enter the value"
android:defaultValue='7.30'/>
</PreferenceScreen>
</PreferenceCategory>
我必须添加所有税值。