aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--app/src/main/java/github/daneren2005/dsub/util/SettingsBackupAgent.java9
1 files changed, 9 insertions, 0 deletions
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();
+ }
}