IT. Expert System.

Android Reference


Class BackupManager

  • public class BackupManager
    extends Object
    The interface through which an application interacts with the Android backup service to request backup and restore operations. Applications instantiate it using the constructor and issue calls through that instance.

    When an application has made changes to data which should be backed up, a call to dataChanged() will notify the backup service. The system will then schedule a backup operation to occur in the near future. Repeated calls to dataChanged() have no further effect until the backup operation actually occurs.

    A backup or restore operation for your application begins when the system launches the BackupAgent subclass you've declared in your manifest. See the documentation for BackupAgent for a detailed description of how the operation then proceeds.

    Several attributes affecting the operation of the backup and restore mechanism can be set on the <application> tag in your application's AndroidManifest.xml file.

    Developer Guides

    For more information about using BackupManager, read the Data Backup developer guide.

    • Constructor Detail

      • BackupManager

        public BackupManager(Context context)
        Constructs a BackupManager object through which the application can communicate with the Android backup system.
        context - The Context that was provided when one of your application's Activities was created.
    • Method Detail

      • dataChanged

        public void dataChanged()
        Notifies the Android backup system that your application wishes to back up new changes to its data. A backup operation using your application's BackupAgent subclass will be scheduled when you call this method.
      • dataChanged

        public static void dataChanged(String packageName)
        Convenience method for callers who need to indicate that some other package needs a backup pass. This can be useful in the case of groups of packages that share a uid.

        This method requires that the application hold the "android.permission.BACKUP" permission if the package named in the argument does not run under the same uid as the caller.

        packageName - The package name identifying the application to back up.
      • requestRestore

        public int requestRestore(RestoreObserver observer)
        Restore the calling application from backup. The data will be restored from the current backup dataset if the application has stored data there, or from the dataset used during the last full device setup operation if the current backup dataset has no matching data. If no backup data exists for this application in either source, a nonzero value will be returned.

        If this method returns zero (meaning success), the OS will attempt to retrieve a backed-up dataset from the remote transport, instantiate the application's backup agent, and pass the dataset to the agent's onRestore() method.

        observer - The RestoreObserver to receive callbacks during the restore operation. This must not be null.
        Zero on success; nonzero on error.
      • beginRestoreSession

        public RestoreSession beginRestoreSession()
        Begin the process of restoring data from backup. See the RestoreSession class for documentation on that process.


Android Reference

Java basics

Java Enterprise Edition (EE)

Java Standard Edition (SE)





Java Script








Design patterns

RFC (standard status)

RFC (proposed standard status)

RFC (draft standard status)

RFC (informational status)

RFC (experimental status)

RFC (best current practice status)

RFC (historic status)

RFC (unknown status)

IT dictionary

All information of this service is derived from the free sources and is provided solely in the form of quotations. This service provides information and interfaces solely for the familiarization (not ownership) and under the "as is" condition.
Copyright 2016 © ELTASK.COM. All rights reserved.
Site is optimized for mobile devices.
Downloads: 544 / 158863030. Delta: 0.04135 с