public interface IInitCallback
Before calling DeviceManager#initDistributedEnvironment(String, IInitCallback) to initialize
the distributed execution framework, you must create a class to implement this interface and override the
IInitCallback#onInitSuccess(String) and IInitCallback#onInitFailure(String, int) methods
for your application to receive the initialization result. If the initialization is successful, your application
will be notified through IInitCallback#onInitSuccess(String). If the initialization fails, your application
will be notified of the initialization failure and error code through
IInitCallback#onInitFailure(String, int). After the cross-device task is complete, your application can call
DeviceManager#unInitDistributedEnvironment(String, IInitCallback) to deactivate the distributed execution
framework and unregister the previously registered callbacks.
| 限定符和类型 | 方法 | 说明 |
|---|---|---|
void |
onInitFailure(String deviceId,
int errorCode) |
Called when the distributed execution framework fails to be initialized.
|
void |
onInitSuccess(String deviceId) |
Called when the distributed execution framework is initialized successfully.
|
void onInitSuccess(String deviceId)
Before calling DeviceManager#initDistributedEnvironment(String, IInitCallback) to initialize the
distributed execution framework, you must implement the IInitCallback interface and override this
method so that your application can be notified when the initialization is successful.
deviceId - Indicates the network ID of the device on which the distributed execution framework is to be
initialized.void onInitFailure(String deviceId, int errorCode)
Before calling DeviceManager#initDistributedEnvironment(String, IInitCallback) to initialize
the distributed execution framework, you must implement the IInitCallback interface and override
this method so that your application can be notified when the initialization fails.
deviceId - Indicates the network ID of the device on which the distributed execution framework is to be
initialized.errorCode - Indicates the error code of the initialization failure.