public interface DeviceChangeCallback
You need to implement this class and call the
KvManager.registerDeviceChangeCallback(ohos.data.distributed.device.DeviceChangeCallback, ohos.data.distributed.device.DeviceFilterStrategy) method to
register the DeviceChangeCallback. The callback will be invoked when the status of a device
changes (online or offline).
SystemCapability.Data#DATA_DISTRIBUTEDDATAMGR| 限定符和类型 | 方法 | 说明 |
|---|---|---|
void |
onChanged(DeviceInfo info,
DeviceStatus status) |
Called when the device status changes.
|
void onChanged(DeviceInfo info, DeviceStatus status)
This callback is invoked when a device goes online or offline.
info - Indicates the device information.status - Indicates the device status after the status change.