On Fri, Jul 8, 2011 at 6:05 PM, OneaDayJ <[email protected]> wrote:
> I tried to sign up for the beginners forum but had no luck.

That Google Group has been discontinued for a year or so.

> My question is that I am reading a book called sams teach yourself
> android development and am completely lost with when it says to use
> the getSharedPreferences() method.  I have no idea where to put that
> method or how to make it in eclipse.

I suggest that you learn Java outside of Android first. There are
plenty of resources available to developers who do not know Java, but
those resources are mostly for Java outside of Android.

As part of that, you will learn how to read standard Java API
documentation (JavaDocs). The reference tab at
http://developer.android.com contains such JavaDocs.

If you search through those JavaDocs, you will find that
getSharedPreferences() is a method on Context, and therefore is a
method on Activity, since Activity inherits from Context.

> it tells me
> “
> To add shared preferences to the application, take the following
> steps:
> 1. Use the getSharedPreferences() method to retrieve an instance of a
> SharedPreferences object.
> 2. Create a SharedPreferences.Editor object to modify preferences.
> 3. Make changes to the preferences by using the editor.
> 4. Commit the changes by using the commit() method in the editor.
> “
>
> now none of that makes sense to me at all, I do not know how to make a
> SharedPreference.Editor object to modify preferences.

Call edit() on a SharedPreferences object to get a
SharedPreferences.Editor object.

-- 
Mark Murphy (a Commons Guy)
http://commonsware.com | http://github.com/commonsguy
http://commonsware.com/blog | http://twitter.com/commonsguy

_Android Programming Tutorials_ Version 3.5 Available!

-- 
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

Reply via email to