JolimarkPrint.searchDevices(context, 6000, TransType.valueOf("TRANS_" + Type.toUpperCase()), new SearchCallback() {
@Override //开始搜索
public void startDevices() {
data.put("code", 0);
data.put("Type", "start");
data.put("message", "搜索中...");
callback.invokeAndKeepAlive(data);
}
@Override //搜索到设备
public void findDevices(DeviceInfo deviceInfo) {
data.put("code", 0);
data.put("Type", "find");
data.put("message", "发现设备");
data.put("deviceInfo", deviceInfo);
Log.d("xing", "发现设备:" + data);
callback.invokeAndKeepAlive(data);
}
@Override //停止搜索
public void stopDevices(List<DeviceInfo> list) {
data.put("code", 0);
data.put("Type", "stop");
data.put("message", "搜索结束");
data.put("deviceInfo", list);
Log.d("xing", "搜索结束:" + data);
callback.invokeAndKeepAlive(data);
if(show==1){
progressDialog.cancel();
}
}
});
new SearchCallback()里的回调这一部分,这个在UTS怎么写
hws007 (作者)
还是不行,实在不会了,算了,还是用原生搞了
2024-01-03 02:17