Commit 3edc6cd6ba4a844b32769e070162923e7e770664
1 parent
57631099
1 修改配网逻辑
Showing
2 changed files
with
10 additions
and
5 deletions
config.gradle
module_xiaojiaSoundBox/src/main/java/com/cnlive/strike/xiaojiaspeaker/frame/view/SelectWifiFragmentView.java
| ... | ... | @@ -285,11 +285,15 @@ public class SelectWifiFragmentView implements MvpView { |
| 285 | 285 | fragment.getPresenter().queryConfigDeviceNetResult(getContext(), familyId, new SelectWifiFragmentPresenter.OnResponseListener() { |
| 286 | 286 | @Override |
| 287 | 287 | public void onSuccess(NetworkResultBean networkResultBean) { |
| 288 | + if (null==getContext()){ | |
| 289 | + return; | |
| 290 | + } | |
| 291 | + QMUITipDialogUtil.dismessDialog(); | |
| 288 | 292 | //判断是否绑定 |
| 289 | 293 | if (networkResultBean.isIsBinded()&&"success".equals(networkResultBean.getResult().trim())) { |
| 290 | 294 | ConnBluetoothSuccessActivity.startActivity(getContext(), networkResultBean); |
| 291 | 295 | } else { |
| 292 | - AlertUtil.showDeftToast(getContext(), "配网失败,"); | |
| 296 | + AlertUtil.showDeftToast(getContext(), "配网失败"); | |
| 293 | 297 | } |
| 294 | 298 | } |
| 295 | 299 | }); |
| ... | ... | @@ -299,6 +303,9 @@ public class SelectWifiFragmentView implements MvpView { |
| 299 | 303 | if (null != failHandler && null != failRunnable) { |
| 300 | 304 | failHandler.removeCallbacks(failRunnable); |
| 301 | 305 | } |
| 306 | + QMUITipDialogUtil.dismessDialog(); | |
| 307 | + BleManager.getInstance().stopNotify(bleDevice, BlufiConstants.UUID_WIFI_SERVICE.toString(), BlufiConstants.UUID_NOTIFY_CHARACTERISTIC.toString()); | |
| 308 | + BleManager.getInstance().disconnect(bleDevice); | |
| 302 | 309 | if (null != errorDialog) { |
| 303 | 310 | if (!TextUtils.isEmpty(SSID)) { |
| 304 | 311 | errorDialog.setTipMsg(SSID + "\n密码错误"); |
| ... | ... | @@ -307,9 +314,7 @@ public class SelectWifiFragmentView implements MvpView { |
| 307 | 314 | } |
| 308 | 315 | } |
| 309 | 316 | } |
| 310 | - QMUITipDialogUtil.dismessDialog(); | |
| 311 | - BleManager.getInstance().stopNotify(bleDevice, BlufiConstants.UUID_WIFI_SERVICE.toString(), BlufiConstants.UUID_NOTIFY_CHARACTERISTIC.toString()); | |
| 312 | - BleManager.getInstance().disconnect(bleDevice); | |
| 317 | + | |
| 313 | 318 | } |
| 314 | 319 | } catch (UnsupportedEncodingException e) { |
| 315 | 320 | e.printStackTrace(); | ... | ... |