dwarvesf / til

Today I Learned. Our knowledge hub. List out what we've learned everyday, organized.
29 stars 1 forks source link

ListPreference: use string-array as Entry and integer-array as Entry Values doesn't work #9

Open nambv opened 7 years ago

nambv commented 7 years ago

http://stackoverflow.com/questions/11346916/listpreference-use-string-array-as-entry-and-integer-array-as-entry-values-does

nambv commented 7 years ago

The answer is simple: because the Android is designed this way. It just uses String arrays for both entries and entry values and that's all. And I can't see any problem in this fact, since you can easily convert a String to an int using the Integer.parseInt() method. Hope this helps.

labermt commented 5 years ago

The problem is it isn't documented to only use string-array's. Very confusing and unexpected. Poor interface design.