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

Reply via email to