hxb
2022-11-25 49c135d23c6038a8c456cf1fcf450e5fb649047a
AndroidOpenDemo/app/src/main/java/com/utils/DeviceUtils.java
@@ -25,10 +25,12 @@
public class DeviceUtils implements IGetDeviceInfoCallBack.ISubAccountDevice< DeviceDetailListData.Response>  {
    private String deviceId;
    public DeviceUtils(String deviceId){
    private String titleString;
    public DeviceUtils(String deviceId,String title){
        this.deviceId=deviceId;
        this.titleString = title;
    }
    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 +38,22 @@
    }
    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);
                bundle.putString("titleString",titleString);
                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 +75,21 @@
        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);
                bundle.putString("titleString",titleString);
                Intent intent = new Intent(HdlToLcUtils.getInstance().getActivity(), DeviceOnlineMediaPlayActivity.class);
                intent.putExtras(bundle);
                HdlToLcUtils.getInstance().getActivity().startActivity(intent);
                return;
            }
        }
    }
    @Override
    public void onError(Throwable throwable) {