Re: [android-developers] Save configuration value as integer in Preference Activity

2010-09-16 Thread Chris Greenman
Sorry, yes EditTextPreference is what I was thinking. That and ListPreference is what was hanging me up. I ended up doing as you and others have mentioned and stored the values as strings. > Can you point to where you saw that? The doc for Preferences says: > "It is up to the subclass to deci

Re: [android-developers] Save configuration value as integer in Preference Activity

2010-09-16 Thread TreKing
On Thu, Sep 16, 2010 at 2:43 PM, Chris Greenman wrote: > I believe I remember reading somewhere that Preferences can only be saved > as a String. > Can you point to where you saw that? The doc for Preferences says: "It is up to the subclass to decide how to store the value." and, for example, Ch

Re: [android-developers] Save configuration value as integer in Preference Activity

2010-09-16 Thread Chris Greenman
I believe I remember reading somewhere that Preferences can only be saved as a String. I ran into this myself and just saved it as a string and parsed the value out I needed. Also I believe the "numeric" attribute is deprecated in favor of inputType. On Thu, 2010-09-16 at 09:49 -0700, Laimona

Re: [android-developers] Save configuration value as integer in Preference Activity

2010-09-16 Thread TreKing
On Thu, Sep 16, 2010 at 11:49 AM, Laimonas wrote: > later trying to getInt("SomeKey") on preferences object I always get > java.lang.ClassCastException: > java.lang.String. > Why don't you just getString() then Integer.parse() it? ---

[android-developers] Save configuration value as integer in Preference Activity

2010-09-16 Thread Laimonas
Hi, Is there a way how I can tell the Preference Activity that value should be saved as integer? So far my all values are saved as strings... I can limit input to integers via XML easy: but it is still saved as string and later trying to getInt("SomeKey") on preferences object I always get java