| | |
| | | this.restoreFragment();//恢复fragment页面 |
| | | } else { |
| | | // |
| | | this.removeAllFragments(); |
| | | this.removeAllFragments(mFragmentManager); |
| | | //正常启动时调用 |
| | | if (!fragmentList.isEmpty()) { |
| | | fragmentList.clear(); |
| | |
| | | ft.commit(); |
| | | } |
| | | |
| | | private void removeAllFragments() { |
| | | if (mFragmentManager == null) return; |
| | | private void removeAllFragments(FragmentManager manager) { |
| | | if (manager == null) return; |
| | | try { |
| | | final List<Fragment> fragments = mFragmentManager.getFragments(); |
| | | final List<Fragment> fragments = manager.getFragments(); |
| | | if (fragments.isEmpty()) { |
| | | return; |
| | | } |
| | | FragmentTransaction transaction = mFragmentManager.beginTransaction(); |
| | | FragmentTransaction transaction = manager.beginTransaction(); |
| | | for (int i = 0; i < fragments.size(); i++) { |
| | | Fragment fragment = fragments.get(i); |
| | | if (fragment != null) { |
| | | // FragmentManager childManager = fragment.getChildFragmentManager(); |
| | | // removeAllFragments(childManager); |
| | | transaction.remove(fragment); |
| | | } |
| | | } |
| | |
| | | uniCallBackBaseBean.setData(linkResponse.getData()); |
| | | HdlUniLogic.getInstance().sendUni(HDLUniMP.UNI_EVENT_NOTIFICATION_DEVICE_MODEL, uniCallBackBaseBean); |
| | | HdlLogLogic.print(linkResponse.getTopic() + new Gson().toJson(linkResponse.getData()), true); |
| | | // HdlDeviceLogic.getInstance().searchAllNetworkGateway(null);//逆变器wifi状态-重新搜索一下逆变器-重新更新连接状态 |
| | | } else if (linkResponse.getTopic().endsWith("/app/thing/event/appHomeRemoveRefresh/up")) { |
| | | String[] topicArray = linkResponse.getTopic().split("/"); |
| | | //住宅删除通知 |
| | |
| | | return; |
| | | } |
| | | int index = -1; |
| | | List<GatewayBean> list = HdlDeviceLogic.getInstance().getCurrentHomeGatewayList(UserConfigManage.getInstance().getHomeId(), null); |
| | | List<GatewayBean> list = HdlDeviceLogic.getInstance().getCurrentHomeGatewayList(UserConfigManage.getInstance().getHomeId()); |
| | | for (int i = 0; i < list.size(); i++) { |
| | | GatewayBean gatewayBean = list.get(i); |
| | | if (gatewayBean.getGatewayId().equals(topics[2])) { |