Created
November 12, 2015 23:04
-
-
Save tseglevskiy/e71cd081c2d8ef07c0a3 to your computer and use it in GitHub Desktop.
Auto Backup
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<application | |
android:allowBackup="true" | |
android:fullBackupContent="@xml/mybackupscheme" | |
....... | |
android:backupAgent=".MyBackupAgent" | |
> | |
....... | |
</application> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class MyBackupAgent extends BackupAgent { | |
@Override | |
public void onRestoreFinished() { | |
super.onRestoreFinished(); | |
Log.d("jollydroid", "onRestoreFinished"); | |
} | |
@Override | |
public void onBackup(ParcelFileDescriptor oldState, BackupDataOutput data, | |
ParcelFileDescriptor newState) throws IOException {} | |
@Override | |
public void onRestore(BackupDataInput data, int appVersionCode, ParcelFileDescriptor newState) throws IOException {} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="utf-8"?> | |
<full-backup-content> | |
<include | |
domain="sharedpref" | |
path="pref1.xml"/> | |
</full-backup-content> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment