Not to force you to read the source code, the correct code is:
public class Calculator_Backup
extends
android.app.backup.BackupAgentHelper
{
…
final android.app.backup.SharedPreferencesBackupHelper helper =
new android.app.backup.SharedPreferencesBackupHelper (
/* context => */this,
/* prefGroups => */this.getPackageName () + "_preferences");
this.addHelper (
/* keyPrefix => */Calculator_Backup.PREFERENCES_BACKUP_KEY,
/* helper => */helper);
Calculator_Backup need to be in the same package as your shared preferences.
No comments:
Post a Comment