I am working on an app called Drive Mode which will allow the user to enter a custom message in the settings and have this message auto-replied to any incoming text. (Along with other features of course) My problem is trying to reference a static string and using getApplicationContext();
I am grabbing the text from an EditTextPreference and am trying to access this string in multiple activities.
FIXED: This problem is now fixed and I have edited the entire post to better help others who possibly have this same problem. Thank you for all the help.
public class Main extends Activity implements OnSharedPreferenceChangeListener {
...
public static String reply = "";
...
public void loadPreferences() {
SharedPreferences settings = PreferenceManager.getDefaultSharedPreferences(getApplicationContext());
settings.registerOnSharedPreferenceChangeListener(Main.this);
if (settings.getBoolean("cbReply", true)) {
reply = settings.getString("tbMessage", "@string/pd_message");
...
} else {
...
}