BackupAgent.OnFullBackup(FullBackupDataOutput) Method

Definition

The application is having its entire file system contents backed up.

[Android.Runtime.Register("onFullBackup", "(Landroid/app/backup/FullBackupDataOutput;)V", "GetOnFullBackup_Landroid_app_backup_FullBackupDataOutput_Handler")]
public virtual void OnFullBackup (Android.App.Backup.FullBackupDataOutput? data);
[<Android.Runtime.Register("onFullBackup", "(Landroid/app/backup/FullBackupDataOutput;)V", "GetOnFullBackup_Landroid_app_backup_FullBackupDataOutput_Handler")>]
abstract member OnFullBackup : Android.App.Backup.FullBackupDataOutput -> unit
override this.OnFullBackup : Android.App.Backup.FullBackupDataOutput -> unit

Parameters

data
FullBackupDataOutput

A structured wrapper pointing to the backup destination.

Attributes

Exceptions

Remarks

The application is having its entire file system contents backed up. data points to the backup destination, and the app has the opportunity to choose which files are to be stored. To commit a file as part of the backup, call the #fullBackupFile(File, FullBackupDataOutput) helper method. After all file data is written to the output, the agent returns from this method and the backup operation concludes.

Certain parts of the app's data are never backed up even if the app explicitly sends them to the output:

<ul> <li>The contents of the #getCacheDir() directory</li> <li>The contents of the #getCodeCacheDir() directory</li> <li>The contents of the #getNoBackupFilesDir() directory</li> <li>The contents of the app's shared library directory</li> </ul>

The default implementation of this method backs up the entirety of the application's "owned" file system trees to the output other than the few exceptions listed above. Apps only need to override this method if they need to impose special limitations on which files are being stored beyond the control that #getNoBackupFilesDir() offers. Alternatively they can provide an xml resource to specify what data to include or exclude.

Java documentation for android.app.backup.BackupAgent.onFullBackup(android.app.backup.FullBackupDataOutput).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to

See also

  • NoBackupFilesDir
  • <xref:Android.App.Backup.BackupAgent.FullBackupFile(Java.IO.File%2c+Android.App.Backup.FullBackupDataOutput)>
  • <xref:Android.App.Backup.BackupAgent.OnRestoreFile(Android.OS.ParcelFileDescriptor%2c+System.Int64%2c+System.Int64%2c+System.Int64%2c+System.Int64%2c+System.Int64)>