0

My app has the ability to backup and restore SharedPreferences using an BackupAgentHelper class. However there are two entries that must not restored.

Is there a way to reset them after restoring again?

I don't want to put them in a different SharedPreference, they have to be in the same file.

Parth Bhatt
  • 19,381
  • 28
  • 133
  • 216
Force
  • 6,312
  • 7
  • 54
  • 85

1 Answers1

1

Use the onBackup or onRestore methods of the BackupAgent to clear out the values before or after the operation.

Kuffs
  • 35,581
  • 10
  • 79
  • 92
  • Damn I was thinking too much out of the box and completely forgot about the onRestore interface... Thanks! – Force Apr 06 '12 at 22:19