diff options
| author | Samuel Tardieu <sam@rfc1149.net> | 2013-01-23 09:22:04 +0100 |
|---|---|---|
| committer | Samuel Tardieu <sam@rfc1149.net> | 2013-01-23 09:22:04 +0100 |
| commit | 07e614c71e22d5bc7a6fc3e31557b4d20a21daea (patch) | |
| tree | 187afdd53f7a12bba7c587c41551edaccf0a5ed3 /main/src/cgeo/geocaching/backup | |
| parent | 49a756515566db95b4bf280c70a5ca03812ee488 (diff) | |
| download | cgeo-07e614c71e22d5bc7a6fc3e31557b4d20a21daea.zip cgeo-07e614c71e22d5bc7a6fc3e31557b4d20a21daea.tar.gz cgeo-07e614c71e22d5bc7a6fc3e31557b4d20a21daea.tar.bz2 | |
fix #2317: NPE while backuping data
The previous fix for #2317 was incomplete, as the dependency of the
CentralBackupAgent onto Settings caused a NPE because Settings static
initializations require that an application has been created, which is
apparently not the case when a backup is launched by the OS.
The preference name has been isolated into a no-dependency package so
that the CentralBackupAgent does not depend on an application existing
anymore.
Diffstat (limited to 'main/src/cgeo/geocaching/backup')
| -rw-r--r-- | main/src/cgeo/geocaching/backup/CentralBackupAgent.java | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/main/src/cgeo/geocaching/backup/CentralBackupAgent.java b/main/src/cgeo/geocaching/backup/CentralBackupAgent.java index f6b9024..28a668c 100644 --- a/main/src/cgeo/geocaching/backup/CentralBackupAgent.java +++ b/main/src/cgeo/geocaching/backup/CentralBackupAgent.java @@ -1,6 +1,6 @@ package cgeo.geocaching.backup; -import cgeo.geocaching.Settings; +import cgeo.geocaching.utils.ApplicationSettings; import android.annotation.TargetApi; import android.app.backup.BackupAgentHelper; @@ -13,7 +13,7 @@ public class CentralBackupAgent extends BackupAgentHelper { @Override public void onCreate() { - final SharedPreferencesBackupHelper helper = new SharedPreferencesBackupHelper(this, Settings.getPreferencesName()); + final SharedPreferencesBackupHelper helper = new SharedPreferencesBackupHelper(this, ApplicationSettings.getPreferencesName()); addHelper(PREFS_BACKUP_KEY, helper); } |
