SharedPreferences prefs = PreferenceManager. getDefaultSharedPreferences(this); String imgSett = prefs. getString(keyChannel, “”); if the value is saved in a SharedPreference in an Activity then this is the correct way to saving it.
Read moreAre SharedPreferences persistent?
Android’s built-in SharedPreferences storage mechanism allows us to store information that persists throughout the entire app . SharedPreferences allows you to create a file that stores primitive values as key-value pairs.
Read more