Skip to main content

Posts

Showing posts with the label restore

onRestore not invoked for my custom BackupAgent

There are some data in my Android app that I would like to backup and restore. For that purpose I have created a custom implementation of BackupAgent. In my manifest in have included the backup agent as you can see below <manifest xmlns:android="http://schemas.android.com/apk/res/android" android:installLocation="auto" package="com.myapp" android:versionCode="14" android:versionName="1.13" > <application android:backupAgent="com.myapp.MyBackupAgent"> <meta-data android:name="com.google.android.backup.api_key" android:value="my key" /> I have included the backup service api key, although I am testing with the emulator (Android 2.2) and it should not be necessary, because it uses the local backup transport. In order to do the test of the backup and restore I have done the following: Start the emulator with my application i