Reputation: 89
var num = pref?.getInt("something", 1)
This gives me "java.lang.Long cannot be cast to java.lang.Integer, null"
However I don’t see a long here. Am I missing something?
Upvotes: 0
Views: 318
Reputation: 61
"pref" contains Long class may be
you should try
var num = pref?.getLong(“something”,1L)
Upvotes: 3