Strict Standards: Non-static method utf_normalizer::nfc() should not be called statically in /www/htdocs/w006661d/anddev/includes/utf/utf_tools.php on line 1781
[phpBB Debug] PHP Notice: in file /includes/session.php on line 1007: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)
[phpBB Debug] PHP Notice: in file /includes/session.php on line 1007: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)
[phpBB Debug] PHP Notice: in file /includes/session.php on line 1007: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)

Strict Standards: Non-static method utf_normalizer::nfc() should not be called statically in /www/htdocs/w006661d/anddev/includes/utf/utf_tools.php on line 1781

Strict Standards: Non-static method utf_normalizer::nfc() should not be called statically in /www/htdocs/w006661d/anddev/includes/utf/utf_tools.php on line 1781
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 4362: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 4364: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 4365: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 4366: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)
anddev.org • View topic - PreferenceActivity help

PreferenceActivity help

Put your problem here if it does not fit any of the other categories.

PreferenceActivity help

Postby zackola » Wed Nov 19, 2008 5:52 am

So,

I want to be able to use SharedPreferences across different Activities in my app. I was doing this fine with a normal Activity that had a bunch of controls in a LinearLayout, and attaching to the OnClickListener events for each control and then commiting the preferences. Then in a different activity I coudl retreive those preferences using

getSharedPreferences(PREFS_NAME, 0);

where PREFS_NAME is a string defined in both activities.

This was going OK, but a little clunky...and then I found PreferenceActivity, and all its promised goodness of automatically handling the persistence of preferences. This is going fine, and values seem to be persisting within the PreferenceActivity, but I can't figure out how to get the preferences that are saved in my PreferenceActivity in other normal Activities.

I hope the answer to this is really simple. It probably is, but it's getting late and my brain is fried. Thanks in advance!
zackola
Freshman
Freshman
 
Posts: 2
Joined: Wed Nov 19, 2008 5:36 am

Top

Postby zackola » Wed Nov 19, 2008 6:33 am

As predicted and answering my own question, I think this does the trick.

PreferenceManager.getDefaultSharedPreferences(this);

Facepalm. http://www.forumammo.com/cpg/albums/use ... cepalm.jpg
zackola
Freshman
Freshman
 
Posts: 2
Joined: Wed Nov 19, 2008 5:36 am

Top

Return to Other Coding-Problems

Who is online

Users browsing this forum: Google [Bot] and 13 guests