getSharedPreferences

by Brad Gies » Sat, 06 Dec 2008 03:02:38 GMT


Sponsored Links
 Can someone clarify how to use getSharedPreferences(String
< http://code.google.com/android/reference/java/lang/String.html> ;  name, int
mode)  ?

 

I have created a preferences.xlm file, added some Boolean preferences, can
edit them from an activity, but I can't seem to figure out how to get the
values into another activity in my application using getSharedPreferences. 

 

I know. it should be simple. and I'm sure it is. but I can't figure out what
name to put in or what mode. 

 

Any help or links to sample code appreciated.

 

 

Sincerely,

 

Brad Gies

 

 

-----------------------------------------------------------------

Brad Gies

27415 Greenfield Rd, # 2,

Southfield, MI, USA

48076

-----------------------------------------------------------------

 

Moderation in everything, including abstinence

 


--~--~---------~--~----~------------~-------~--~----~



getSharedPreferences

by Mark Murphy » Sat, 06 Dec 2008 03:12:12 GMT


 


Use PreferencesManager.getDefaultSharedPreferences() instead. This will 
return the SharedPreferences object that lines up with the preference 
screen system.

-- 
Mark Murphy (a Commons Guy)
 http://commonsware.com 
_The Busy Coder's Guide to Android Development_ Version 1.9 Available!

--~--~---------~--~----~------------~-------~--~----~


Sponsored Links


getSharedPreferences

by Brad Gies » Sat, 06 Dec 2008 11:45:53 GMT


 Thank Mark... as always your advice is exactly what I needed. :) 

By the way, I just downloaded the 1.9 version of your book (wondered what
happened to 1.5... 1.8 but that's another question), and it is even better
than it was... except for one thing.... That's a god awful color of
green.... The red/maroon color you had before was much nicer :). 

But.... I guess if that's the biggest complaint I've got about the book that
pretty well says it all :). I hope you're doing well with it. To be honest,
I've gotten about ten times my moneys' worth from the book in free advice on
this list from you, so if I make money from my app, I'll buy a few copies of
it for some other developers ;). 




Sincerely,
 
Brad Gies
 
 
-----------------------------------------------------------------
Brad Gies
27415 Greenfield Rd, # 2,
Southfield, MI, USA
48076
www.bgies.com  www.truckerphone.com 
www.EDI-Easy.com  www.pricebunny.com
-----------------------------------------------------------------
 
Moderation in everything, including abstinence
-----Original Message-----
From: android-developers@googlegroups.com
[EMAIL PROTECTED] On Behalf Of Mark Murphy
Sent: Friday, December 05, 2008 2:12 PM
To: android-developers@googlegroups.com
Subject: [android-developers] Re: getSharedPreferences





Use PreferencesManager.getDefaultSharedPreferences() instead. This will 
return the SharedPreferences object that lines up with the preference 
screen system.

-- 
Mark Murphy (a Commons Guy)
 http://commonsware.com 
_The Busy Coder's Guide to Android Development_ Version 1.9 Available!



--~--~---------~--~----~------------~-------~--~----~



Other Threads

1. detecting sound signals

Hello,
we are working on a project where we need to detect a sound signal in
real time; that is, to get notified the moment we receive the sound
signal. we don't need to record the sound, because we won't need it
after its detection.
does anyone know how to do this?

thank you
--~--~---------~--~----~------------~-------~--~----~

2. EditText in ListView loses focus after keyboard pops up

Hi all,

I'm (still :) trying to have one page with on top two EditText
searchboxes and a searchbutton.
When the user then presses the searchbutton, the result should appear
below, and during scrolling everything should move up/down, just like
a "regular" google search result.

I've been given a good pointer by Mark Murphy in this post:

3. screen loc

4. The most complete Android Applications list: android.touch-market.com BETA is live

5. ADC 2 Content Policy Guidelines

6. Update to Donut SDKs (4th August)

7. opengl supported well in G2?