我从此链接安装了示例 BackupRestore。
我无法恢复数据。
OnBackup 和 OnCreate 会被调用,但 OnRestore 不会被调用。
我能够备份:OnCreate 和 OnBackup 受到攻击,但 OnRestore 却没有。
@Override
public void onRestore(BackupDataInput data, int appVersionCode,
ParcelFileDescriptor newState) throws IOException {
// Hold the lock while the FileBackupHelper restores the file from
// the data provided here.
synchronized (BackupRestoreActivity.sDataLock) {
super.onRestore(data, appVersionCode, newState);
}
}
public void onRestoreButtonClick(View v) {
Log.v(TAG, "Requesting restore of our most recent data");
mBackupManager.requestRestore(
new RestoreObserver() {
public void restoreFinished(int error) {
/** Done with the restore! Now …Run Code Online (Sandbox Code Playgroud)