Not really sure...

One thing I know that I do differently is how I handle the Editor object.
The way I do it with my code is as follows:

SharedPreferences myPrefs = PreferenceManager.getDefaultPreferences();
Editor prefEditor = myPrefs.edit();
prefEditor.putInt("Some_String",someInt);
prefEditor.commit();
Boolean worked = myPrefs.contains("Some_String");
int returnedInt = myPrefs.getInt("Some_String", someOtherInt );

----------------------------------------------------------------------
There are only 10 types of people in the world...
Those who know binary and those who don't.
----------------------------------------------------------------------


On Thu, Jul 22, 2010 at 3:20 PM, Bret Foreman <bret.fore...@gmail.com>wrote:

> I uninstalled and reinstalled the app. The code now looks like this.
> commit() is returning true but contains() is returning false and
> getInt() is returning someOtherInt. Any ideas?
>
> SharedPreferences myPrefs = PreferenceManager.getDefaultPreferences();
> myPrefs.edit().putInt("Some_String",someInt);
> myPrefs.edit().commit();
> Boolean worked = myPrefs.contains("Some_String");
> int returnedInt = myPrefs.getInt("Some_String", someOtherInt );
>
> --
> 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
> android-beginners+unsubscr...@googlegroups.com<android-beginners%2bunsubscr...@googlegroups.com>
> For more options, visit this group at
> http://groups.google.com/group/android-beginners?hl=en
>

-- 
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
android-beginners+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en

Reply via email to