How does one declare the type of an Android preference?

后端 未结 3 493

I have a preferences.xml that looks like this:




        
3条回答
  •  独厮守ぢ
    2021-01-01 10:59

    As mbaird pointed out you can't force to store as Float.

    But you can change the EditTextPreference to a plain Preference view, and implement the click event for it. This way you will be able to create and show your own Dialog, for edit the value, and thus you can restrict the format and save as Float to the preference file.

提交回复
热议问题