wxr
2023-03-16 68d9078b49cfa8e83ed553835b05d4042c183969
AndroidOpenDemo/DeviceAddModule/src/main/java/com/mm/android/deviceaddmodule/DeviceAddActivity.java
@@ -44,6 +44,8 @@
import com.mm.android.deviceaddmodule.views.popwindow.PopWindowFactory;
import org.greenrobot.eventbus.EventBus;
import org.greenrobot.eventbus.Subscribe;
import org.greenrobot.eventbus.ThreadMode;
import static android.Manifest.permission.ACCESS_COARSE_LOCATION;
import static com.mm.android.deviceaddmodule.mobilecommon.common.Constants.PERMISSION_REQUEST_ID;
@@ -156,6 +158,10 @@
        };
        permissionHelper.requestPermissions(new String[]{
                ACCESS_COARSE_LOCATION}, defaultPermissionListener);
        if(!EventBus.getDefault().isRegistered(this)){
            EventBus.getDefault().register(this);
        }
    }
    //动态权限申请回调
@@ -499,7 +505,25 @@
            }
            mLoadingPopWindow = null;
        }
        EventBus.getDefault().post("backXamarin");
        if(!interfaceException) {
            EventBus.getDefault().post("backXamarin");
        }
    }
    /**
     * 接口异常标记
     */
    private boolean interfaceException = false;
    @Subscribe(threadMode = ThreadMode.MAIN)
    public void onGetMessage(String obj) {
        if(obj.equals("InterfaceException")){
            if (EventBus.getDefault().isRegistered(this)) {
                EventBus.getDefault().unregister(this);
            }
            interfaceException = true;
            destroy();
        }
    }
    // 离线配网成功,返回上一级页面