I'm having a sync adapter in my android app and I'm saving few data in the shared preferences.
Let me explain by taking example as timestamp, in sync adapter I'm storing the timestamp and when I open/use my android app the data is still showing the old data.
I'm using the below code,
public void saveTimeStamp(long timestamp) {
SharedPreferences.Editor editor = sharedPreferences.edit();
editor.putLong("timestamp", timestamp);
editor.apply();
}
public long getLoginTimestamp() {
return sharedPreferences.getLong("timestamp", 0);
}
I tried calling the same method from the app and it is updating. Even I debugged and checked it is calling the above method from sync adapter too but the data is not updating.
In sync adapter I checked logging the data, it is logged correctly but in the app it is not reflected. I'm thinking it is taking separate set of preferences for sync adapter and app since both will be under different process