Most visited

Recently visited

Added in API level 8

RestoreObserver

public abstract class RestoreObserver
extends Object

java.lang.Object
   ↳ android.app.backup.RestoreObserver


在还原操作期间用于接收进度报告的回调类。 这些方法将全部在应用程序的主线程中调用。

Summary

Public constructors

RestoreObserver()

Public methods

void onUpdate(int nowBeingRestored, String currentPackage)

restoreStarting(int)回调中提供的总数中,指示当前正在恢复哪个包。

void restoreFinished(int error)

恢复过程已完成。

void restoreStarting(int numPackages)

恢复操作已开始。

Inherited methods

From class java.lang.Object

Public constructors

RestoreObserver

Added in API level 8
RestoreObserver ()

Public methods

onUpdate

Added in API level 8
void onUpdate (int nowBeingRestored, 
                String currentPackage)

restoreStarting(int)回调中提供的总数中,指示当前正在恢复哪个包。 不保证此方法被调用:如果传输无法获取一个或多个请求的包的数据,则不会为这些包调用onUpdate()调用。

Parameters
nowBeingRestored int: The index, between 1 and the numPackages parameter to the restoreStarting(int) callback, of the package now being restored. This may be non-monotonic; it is intended purely as a rough indication of the backup manager's progress through the overall restore process.
currentPackage String: The name of the package now being restored.

restoreFinished

Added in API level 8
void restoreFinished (int error)

恢复过程已完成。 即使未尝试单个程序包还原操作,也会始终调用此方法。

Parameters
error int: Zero on success; a nonzero error code if the restore operation as a whole failed.

restoreStarting

Added in API level 8
void restoreStarting (int numPackages)

恢复操作已开始。

Parameters
numPackages int: The total number of packages being processed in this restore operation.

Hooray!