I want to share user configuration data with three separate actions. What is the advantage / disadvantage of one methodology over another (using one or three Prefs files)?
I think that if I use it, I will declare the same constant in the main operation, a la:
public static final String PREFS_NAME = "Pterodactyl";
and use getPreferences ();
-OR:
I declare a different const in each Activity, a la:
public static final String PREFS_NAME = "Pterodactyl"; //Activity 1 public static final String PREFS_NAME = "duckbilledPlatypus"; //Activity 2 public static final String PREFS_NAME = "yellowbelliedSapsucker"; //Activity 3
and use getSharedPreferences ();
Is it "6 out of one and a half dozen others" or is it one of these "preferred" over the other, and why?
source share