hxb
2022-11-24 535d69817e83737f3da6250fc6fb70da25fc1a4c
AndroidOpenDemo/app/src/main/java/com/utils/DeviceUtils.java
@@ -28,7 +28,7 @@
    public DeviceUtils(String deviceId){
        this.deviceId=deviceId;
    }
    private List<DeviceDetailListData.ResponseData.DeviceListBean> datas = new ArrayList<>();
    private static List<DeviceDetailListData.ResponseData.DeviceListBean> datas = new ArrayList<>();
    private void getDeviceList() {
        DeviceSubAccountListService deviceSubAccountListService = ClassInstanceManager.newInstance().getDeviceSubAccountListService();
@@ -36,22 +36,21 @@
    }
    public void play() {
        if (datas.size() == 0) {
            getDeviceList();
        } else {
            for (DeviceDetailListData.ResponseData.DeviceListBean deviceListBean : datas) {
                if (deviceListBean.deviceId.equals(deviceId)) {
                    if (!deviceListBean.status.equals("online")) {
                        return;
                    }
                    Bundle bundle = new Bundle();
                    bundle.putSerializable(MethodConst.ParamConst.deviceDetail, deviceListBean);
                    Intent intent = new Intent(HdlToLcUtils.getInstance().getActivity(), DeviceOnlineMediaPlayActivity.class);
                    intent.putExtras(bundle);
                    HdlToLcUtils.getInstance().getActivity().startActivity(intent);
        for (DeviceDetailListData.ResponseData.DeviceListBean deviceListBean : datas) {
            if (deviceListBean.deviceId.equals(deviceId)) {
                if (!deviceListBean.status.equals("online")) {
                    return;
                }
                Bundle bundle = new Bundle();
                bundle.putSerializable(MethodConst.ParamConst.deviceDetail, deviceListBean);
                Intent intent = new Intent(HdlToLcUtils.getInstance().getActivity(), DeviceOnlineMediaPlayActivity.class);
                intent.putExtras(bundle);
                HdlToLcUtils.getInstance().getActivity().startActivity(intent);
                return;
            }
        }
        getDeviceList();
    }
    @Override
    public void DeviceList(DeviceDetailListData.Response responseData) {
@@ -73,7 +72,20 @@
        datas.addAll(responseData.data.deviceList);
        play();
        for (DeviceDetailListData.ResponseData.DeviceListBean deviceListBean : datas) {
            if (deviceListBean.deviceId.equals(deviceId)) {
                if (!deviceListBean.status.equals("online")) {
                    return;
                }
                Bundle bundle = new Bundle();
                bundle.putSerializable(MethodConst.ParamConst.deviceDetail, deviceListBean);
                Intent intent = new Intent(HdlToLcUtils.getInstance().getActivity(), DeviceOnlineMediaPlayActivity.class);
                intent.putExtras(bundle);
                HdlToLcUtils.getInstance().getActivity().startActivity(intent);
                return;
            }
        }
    }
    @Override
    public void onError(Throwable throwable) {