本文整理汇总了Java中com.connectsdk.device.ConnectableDeviceListener类的典型用法代码示例。如果您正苦于以下问题:Java ConnectableDeviceListener类的具体用法?Java ConnectableDeviceListener怎么用?Java ConnectableDeviceListener使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ConnectableDeviceListener类属于com.connectsdk.device包,在下文中一共展示了ConnectableDeviceListener类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onPairingRequired
import com.connectsdk.device.ConnectableDeviceListener; //导入依赖的package包/类
@Override
public void onPairingRequired(ConnectableDevice device, DeviceService service, DeviceService.PairingType pairingType) {
switch (pairingType) {
case FIRST_SCREEN:
mPairingAlertDialog.show();
break;
case PIN_CODE:
mPairingCodeDialog.show();
break;
case NONE:
default:
break;
}
for(ConnectableDeviceListener listener : mDeviceListeners)
listener.onPairingRequired(device, service, pairingType);
}
示例2: addDeviceListener
import com.connectsdk.device.ConnectableDeviceListener; //导入依赖的package包/类
public void addDeviceListener(ConnectableDeviceListener listener) {
mDeviceListeners.add(listener);
}
示例3: removeDeviceListener
import com.connectsdk.device.ConnectableDeviceListener; //导入依赖的package包/类
public void removeDeviceListener(ConnectableDeviceListener listener) {
mDeviceListeners.remove(listener);
}
示例4: onCapabilityUpdated
import com.connectsdk.device.ConnectableDeviceListener; //导入依赖的package包/类
@Override
public void onCapabilityUpdated(ConnectableDevice device, List<String> added, List<String> removed) {
for(ConnectableDeviceListener listener : mDeviceListeners)
listener.onCapabilityUpdated(device, added, removed);
}
示例5: onConnectionFailed
import com.connectsdk.device.ConnectableDeviceListener; //导入依赖的package包/类
@Override
public void onConnectionFailed(ConnectableDevice device, ServiceCommandError error) {
Toast.makeText(mContext, R.string.unknown_error, Toast.LENGTH_SHORT).show();
for(ConnectableDeviceListener listener : mDeviceListeners)
listener.onConnectionFailed(device, error);
}