aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorScott Jackson <daneren2005@gmail.com>2015-12-08 17:42:53 -0800
committerScott Jackson <daneren2005@gmail.com>2015-12-08 17:42:53 -0800
commitd9cf55f61b76d7d6c10fe9aa3a23d5c0b91b99dd (patch)
tree69b28eb959bb57002e0be2efb127581bb4cbac45
parentc56824f9e6fda0ad3439d55de034afe0fc612084 (diff)
downloaddsub-d9cf55f61b76d7d6c10fe9aa3a23d5c0b91b99dd.tar.gz
dsub-d9cf55f61b76d7d6c10fe9aa3a23d5c0b91b99dd.tar.bz2
dsub-d9cf55f61b76d7d6c10fe9aa3a23d5c0b91b99dd.zip
On settings restore remove cache location since they differ from device to device
-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();
+ }
}