Getting integer or index values from a list preference

后端 未结 4 1352
庸人自扰
庸人自扰 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:26

    Andrew was correct, the thread is here:

    it's still being commented on, and yet no change (as of 2.3.3 anyway).

    Integer.parseInt() of .valueOf() will have to work. If valueOf() works without error, use it, as it doesn't allocate as much as parseInt() does, helpful when you NEED to avoid GC like I do.

提交回复
热议问题