diff --git a/modules/mogo-module-common/src/main/java/com/mogo/module/common/error/ARoutDegradeService.java b/modules/mogo-module-common/src/main/java/com/mogo/module/common/error/ARoutDegradeService.java new file mode 100644 index 0000000000..f35f14bad3 --- /dev/null +++ b/modules/mogo-module-common/src/main/java/com/mogo/module/common/error/ARoutDegradeService.java @@ -0,0 +1,25 @@ +package com.mogo.module.common.error; + +import android.content.Context; + +import com.alibaba.android.arouter.facade.Postcard; +import com.alibaba.android.arouter.facade.service.DegradeService; +import com.mogo.utils.logger.Logger; + +/** + * 自定义当个 ARouter 加载失败的服务 + * @author donghongyu + */ +public class ARoutDegradeService implements DegradeService { + private String TAG = this.getClass().getSimpleName(); + + @Override + public void onLost(Context context, Postcard postcard) { + Logger.w(TAG, "postcard:" + postcard); + + } + + @Override + public void init(Context context) { + } +} diff --git a/modules/mogo-module-main/src/main/java/com/mogo/module/main/service/MogoMainService.java b/modules/mogo-module-main/src/main/java/com/mogo/module/main/service/MogoMainService.java index 56bec93b55..0483e43e71 100644 --- a/modules/mogo-module-main/src/main/java/com/mogo/module/main/service/MogoMainService.java +++ b/modules/mogo-module-main/src/main/java/com/mogo/module/main/service/MogoMainService.java @@ -92,7 +92,7 @@ class MogoMainService extends Service implements IMogoLocationListener { private void startTanluService() { UiThreadHandler.postDelayed(() -> { Logger.d(TAG, "startTanluService ---------- "); - if (mServiceApis != null) { + if (mServiceApis != null && mServiceApis.getTanluApi() != null) { mServiceApis.getTanluApi().startTanluService(); } }, 2_000L