Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Shared Preferences Between Activities

Tags:

java

android

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

like image 830
Coops5575 Avatar asked Dec 10 '25 01:12

Coops5575


1 Answers

Here is a very good tutorial that answers your questions

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

like image 50
Future2020 Avatar answered Dec 12 '25 14:12

Future2020



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!