public abstract class RestoreObserver
extends Object
java.lang.Object | |
↳ | android.app.backup.RestoreObserver |
在还原操作期间用于接收进度报告的回调类。 这些方法将全部在应用程序的主线程中调用。
Public constructors |
|
---|---|
RestoreObserver() |
Public methods |
|
---|---|
void |
onUpdate(int nowBeingRestored, String currentPackage) 在 |
void |
restoreFinished(int error) 恢复过程已完成。 |
void |
restoreStarting(int numPackages) 恢复操作已开始。 |
Inherited methods |
|
---|---|
From class java.lang.Object
|
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. |
void restoreFinished (int error)
恢复过程已完成。 即使未尝试单个程序包还原操作,也会始终调用此方法。
Parameters | |
---|---|
error |
int : Zero on success; a nonzero error code if the restore operation as a whole failed. |
void restoreStarting (int numPackages)
恢复操作已开始。
Parameters | |
---|---|
numPackages |
int : The total number of packages being processed in this restore operation. |