Getting integer or index values from a list preference

后端 未结 4 1355
庸人自扰
庸人自扰 2020-12-17 08:30

I\'m creating lists in a shared preference and when the onPreferenceChanged() method is called I want to extract the index of the item in the list or an integer value in som

4条回答
  •  我在风中等你
    2020-12-17 09:15

    Put the preferences in as String and use Integer.parseInt(). I think there is actually a bug report on the limitation you are referring to but I can't find the link. From experience I can tell you to just use Strings and save your self a lot of frustration.

    Note to other SO users, if you can prove me wrong, I welcome it.

提交回复
热议问题