From d9cf55f61b76d7d6c10fe9aa3a23d5c0b91b99dd Mon Sep 17 00:00:00 2001 From: Scott Jackson Date: Tue, 8 Dec 2015 17:42:53 -0800 Subject: On settings restore remove cache location since they differ from device to device --- .../java/github/daneren2005/dsub/util/SettingsBackupAgent.java | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'app/src') diff --git a/app/src/main/java/github/daneren2005/dsub/util/SettingsBackupAgent.java b/app/src/main/java/github/daneren2005/dsub/util/SettingsBackupAgent.java index 7eb6d137..9b6a20a5 100644 --- a/app/src/main/java/github/daneren2005/dsub/util/SettingsBackupAgent.java +++ b/app/src/main/java/github/daneren2005/dsub/util/SettingsBackupAgent.java @@ -19,13 +19,22 @@ package github.daneren2005.dsub.util; import android.app.backup.BackupAgentHelper; +import android.app.backup.BackupDataInput; import android.app.backup.SharedPreferencesBackupHelper; +import android.os.ParcelFileDescriptor; + import github.daneren2005.dsub.util.Constants; public class SettingsBackupAgent extends BackupAgentHelper { + @Override public void onCreate() { super.onCreate(); SharedPreferencesBackupHelper helper = new SharedPreferencesBackupHelper(this, Constants.PREFERENCES_FILE_NAME); addHelper("mypreferences", helper); } + + @Override + public void onRestore(BackupDataInput data, int appVersionCode, ParcelFileDescriptor newState) { + Util.getPreferences(this).edit().remove(Constants.PREFERENCES_KEY_CACHE_LOCATION).apply(); + } } -- cgit v1.2.3