How do I cast from int to generic type Integer?

前端 未结 3 1417
猫巷女王i
猫巷女王i 2021-01-27 12:48

I\'m relatively new to Java and am used to generics in C# so have struggled a bit with this code. Basically I want a generic method for getting a stored Android preference by ke

3条回答
  •  北荒
    北荒 (楼主)
    2021-01-27 13:10

    It turns out the preference I'm trying to read is stored as a string so the cast exception is coming from inside the Android code not mine. Thanks for your help. But as I am a Java-newbie, if you think there is anything generally wrong with my routine, please teach me a better way.

提交回复
热议问题