I have a 'SharedPreference' in my Android Application class file like this :
public class App extends Application {
public static Context context;
public static SharedPreferences preference;
@Override
public void onCreate() {
super.onCreate();
context = getApplicationContext();
preference = PreferenceManager.getDefaultSharedPreferences(context);
}
}
I put values to preference from a long running background service, so when I want to update my fragment content on fragment resume from this preference, in first load of activity and fragment everything is OK, but when I switch fragments, my fragment contents doesn't get updated. Please help with this.