Coops5575
Coops5575

Reputation: 441

Shared Preferences Between Activities

Still fairly new to android, wondered if anyone can help...

I have an App that has multiple activities. Each Activity has a shared preferences file to save strings for that activity. Each preference has its own name.

However, i want any activity to be able to read all preferences....

Am i right in thinking that if i rename them all to the same preference name, that preference will be accessible from any activity within my App?

Or do i need to create a seperate class to handle all preferences?

Many thanks

Upvotes: 3

Views: 3303

Answers (1)

Bashar Altakrouri
Bashar Altakrouri

Reputation: 10595

Here is a very good tutorial that answers your questions

http://saigeethamn.blogspot.de/2009/10/shared-preferences-android-developer.html

Upvotes: 1

Related Questions