On Fri, Jul 9, 2010 at 1:58 PM, Bret Foreman <[email protected]> wrote: > First SharedPreferences.getInt and SharedPreferences.getFloat are both > throwing ClassCastException.
That is because the preferences in question are not integers or floats. The ClassCastException will tell you what the actual type of data is that you are dealing with (probably a string). Retrieve the preference in its native format, then convert it as needed in Java code. > In addition, ListPreference is stopping with an uncaught > exception when I attempt to set the preference from the screen, but > only if there is a defaultValue set. AFAIK, you cannot have a ListPreference of an <integer-array>. -- Mark Murphy (a Commons Guy) http://commonsware.com | http://github.com/commonsguy http://commonsware.com/blog | http://twitter.com/commonsguy _The Busy Coder's Guide to Android Development_ Version 3.1 Available! -- You received this message because you are subscribed to the Google Groups "Android Beginners" group. NEW! Try asking and tagging your question on Stack Overflow at http://stackoverflow.com/questions/tagged/android To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en

