| | |
| | | houseIdBean.setDebugStatus(DebugStatus.Debugging); |
| | | HdlResidenceLogic.getInstance().updateHouseIdBean(houseIdBean); |
| | | initData(); |
| | | if (houseInfoAdapter != null) { |
| | | houseInfoAdapter.setList(houseListBeanIDList, powerStationStatusValue);//重新刷新列表 |
| | | } |
| | | //更新UI |
| | | houseInfoAdapter.notifyItemChanged(position); |
| | | // houseInfoAdapter.notifyItemChanged(position); |
| | | } |
| | | } |
| | | |
| | |
| | | }); |
| | | } else { |
| | | showLoading(getString(R.string.deleting_please_wait)); |
| | | HdlDeviceLogic.getInstance().getCurrentHomeLocalAndCloudGatewayList(houseIdBean.getHomeId(), new CloudCallBeak<List<GatewayBean>>() { |
| | | @Override |
| | | public void onSuccess(List<GatewayBean> list) { |
| | | //发起删除电站指令 |
| | | deleteResidence(position, houseIdBean, list); |
| | | if (houseIdBean.getDebugType().equals(DebugType.NORMAL)) { |
| | | //【常规方式】发起删除电站指令 |
| | | HdlDeviceLogic.getInstance().getCurrentHomeLocalAndCloudGatewayList(houseIdBean.getHomeId(), new CloudCallBeak<List<GatewayBean>>() { |
| | | @Override |
| | | public void onSuccess(List<GatewayBean> list) { |
| | | //发起删除电站指令 |
| | | deleteResidence(position, houseIdBean, list); |
| | | |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public void onFailure(HDLException e) { |
| | | //发起删除电站指令 |
| | | deleteResidence(position, houseIdBean, null); |
| | | } |
| | | }); |
| | | @Override |
| | | public void onFailure(HDLException e) { |
| | | //发起删除电站指令 |
| | | deleteResidence(position, houseIdBean, null); |
| | | } |
| | | }); |
| | | } else { |
| | | //【简易方式】发起删除电站指令 |
| | | deleteResidence(position, houseIdBean, null); |
| | | } |
| | | } |
| | | } |
| | | }); |
| | |
| | | |
| | | public void requestPermissions(OnCallBeak onCallBeak) { |
| | | |
| | | //ACCESS_FINE_LOCATION 允许使用GPS定位 |
| | | //ACCESS_COARSE_LOCATION 允许使用WIFI热点或基站来获取粗略的定位 |
| | | //ACCESS_FINE_LOCATION 允许使用GPS定位 |
| | | //ACCESS_COARSE_LOCATION 允许使用WIFI热点或基站来获取粗略的定位 |
| | | String[] ary = PermissionUtils.checkPermission(_mActivity, new String[]{Manifest.permission.ACCESS_FINE_LOCATION, Manifest.permission.ACCESS_COARSE_LOCATION}); |
| | | if (ary.length > 0) { |
| | | this.requestPermissions(ary, PermissionUtils.STATUS_SUCCESS); |
| | |
| | | } |
| | | |
| | | |
| | | } |
| | | } |