I have a Config class which receives the settings from server. These settings are then applied in an activity method named ApplySettings(). I called this ApplySettings() function onCreate function. first time it worked fine but I could not detect setting change in Activity class. I want to call this ApplySettings() method from Config class as soon as settings change there. How can I do this? Thanks
Config.Java //Singleton class public class Config { public String name = ""; public void getSettingsFromServer() { name = "";//name received from server } } MyActivity.java public class SettingsSystem extends AppCompatActivity { private Config config = Config.getInstance(); protected void onCreate (Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_settings_system); ApplySettings(); } public void ApplySettings() { //settings are applied here } } Both classes are in separate files.