I have a user preference in my app, which gets used by different activities. I would like to know the best way to utilize those preferences between different activities in my App.
I have this idea to create a shared preference object from the main activity and from there send intents to the different activities to take actions. Would that work…?
Or just keep calling getsharedpreferences() from every activity..?
Thanks.
Sending shared preferences through intents seems overcomplicated. You could wrap the shared preferences with something like the below and call the methods directly from your activities: