Listing 1112 Example of Extending the Backup AgentHelper

public class MyFileBackupAgentHelper extends BackupAgentHelper { ^Override public void onCreate() {

FileBackupHelper filehelper = new FileBackupHelper(this,


addHelper(FILE_HELPER_KEY, helper); SharedPreferencesBackupHelper xmlhelper

= new SharedPreferencesBackupHelper(this, PREFS); addHelper(PREFS_BACKUP_KEY, helper);

All backup agent helpers need an onCreate() method.The BackupAgent can have more than one backup helper. In the class extended with BackupAgentHelper, it does not need to override onBackup and onRestore because it is handled well by the BackupAgent.

Character Building Thought Power

Character Building Thought Power

Character-Building Thought Power by Ralph Waldo Trine. Ralph draws a distinct line between bad and good habits. In this book, every effort is made by the writer to explain what comprises good habits and why every one needs it early in life. It draws the conclusion that habits nurtured in early life concretize into impulses in future for the good or bad of the subject.

Get My Free Ebook


  • hietam
    How to use backupagenthelper example?
    7 years ago

Post a comment