On Sat, Dec 17, 2011 at 11:22 PM, Larry/MavrickProductions <
[email protected]> wrote:
> SharedPreferences prefs
> = PreferenceManager.getDefaultSharedPreferences(this);
> SharedPreferences myPrefs =
> this.getSharedPreferences("settings", MODE_PRIVATE);
> final SharedPreferences.Editor prefsEditor = myPrefs.edit();
>
> final int setyear1 = prefs.getInt("setyear", 2036);
>
> What am I missing?
>
Since you're creating two different instances of SharedPreferences without
explanation, and getting the value from "prefs", the default one, I would
have to guess that you're *setting* it in "myPrefs", the one that points to
the "settings" preference.
Also, what is the point of "prefsEditor" ?
-------------------------------------------------------------------------------------------------
TreKing <http://sites.google.com/site/rezmobileapps/treking> - Chicago
transit tracking app for Android-powered devices
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en