Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialZubeyr Aciksari
21,074 PointsWe have an amazing app that knows the Answer to the Ultimate Question of Life, the Universe, and Everything. We need to
Can someone please help me here? I need help.. Thanks!
SharedPreferences mSharedPreferences;
SharedPreferences.Editor editor;
SharedPreferences mSharedPreferences = PreferenceManager.getDefaultSharedPreferences(context);
2 Answers
James Simshaw
28,738 PointsHello,
In your line
SharedPreferences mSharedPreferences = PreferenceManager.getDefaultSharedPreferences(context);
You are trying to declare a SharedPreferences object named mSharedPreferences when you already have it declared in your first line of the Challenge. So if you just say
mSharedPreferences = PreferenceManager.getDefaultSharedPreferences(context);
instead, everything should be fine.
Zubeyr Aciksari
21,074 PointsThanks a lot James, it helped a lot!
James Simshaw
28,738 PointsYou're welcome. Have fun with Android Programming.