From 47a8e7f473c25005c9f3c3395ea1b981fd591c9d Mon Sep 17 00:00:00 2001 From: 18142669586 <1669783059@qq.com> Date: Fri, 26 Jul 2024 15:37:45 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E7=94=A8=E6=88=B7?= =?UTF-8?q?=E5=BC=80=E6=92=AD=E6=8F=90=E7=A4=BA=E5=88=9D=E5=A7=8B=E5=8C=96?= =?UTF-8?q?=E6=9C=AA=E6=88=90=E5=8A=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/shayu/phonelive/AppContext.java | 2 +- .../yunbao/main/activity/MainActivity.java | 22 +++++++++++++++++-- 2 files changed, 21 insertions(+), 3 deletions(-) diff --git a/app/src/main/java/com/shayu/phonelive/AppContext.java b/app/src/main/java/com/shayu/phonelive/AppContext.java index 2beb5a4b8..5fdd43c17 100644 --- a/app/src/main/java/com/shayu/phonelive/AppContext.java +++ b/app/src/main/java/com/shayu/phonelive/AppContext.java @@ -220,7 +220,7 @@ public class AppContext extends CommonAppContext { } CrashSaveBean.getInstance().setStartTime(System.currentTimeMillis()); //注册全局异常捕获 - registerError(); + registerE性格rror(); registerFirebaseCrash(); LogUtils.start(this); sInstance = this; diff --git a/main/src/main/java/com/yunbao/main/activity/MainActivity.java b/main/src/main/java/com/yunbao/main/activity/MainActivity.java index 44f2620ba..1895107f0 100644 --- a/main/src/main/java/com/yunbao/main/activity/MainActivity.java +++ b/main/src/main/java/com/yunbao/main/activity/MainActivity.java @@ -1,6 +1,7 @@ package com.yunbao.main.activity; import static com.yunbao.common.CommonAppContext.isReady; +import static com.yunbao.common.manager.imrongcloud.RongcloudIMManager.connectIM; import android.Manifest; import android.animation.Animator; @@ -51,6 +52,7 @@ import com.tencent.imsdk.v2.V2TIMManager; import com.tencent.imsdk.v2.V2TIMSDKConfig; import com.tencent.imsdk.v2.V2TIMSDKListener; import com.tencent.imsdk.v2.V2TIMUserFullInfo; +import com.yunbao.common.utils.AppManager; import com.yunbao.common.utils.MobclickAgent; import com.yunbao.common.CommonAppConfig; import com.yunbao.common.Constants; @@ -877,13 +879,29 @@ public class MainActivity extends AbsActivity implements MainAppBarLayoutListene } private void showStartDialog() { - if (isReady == true) { MainStartDialogFragment dialogFragment = new MainStartDialogFragment(); dialogFragment.setMainStartChooseCallback(true, this); dialogFragment.show(getSupportFragmentManager(), "MainStartDialogFragment"); } else { - ToastUtil.show("正在初始化,請稍等...."); + connectIM(AppManager.getInstance().getMainActivity(), new RongIMClient.ConnectCallback() { + @Override + public void onSuccess(String t) { + MainStartDialogFragment dialogFragment = new MainStartDialogFragment(); + dialogFragment.setMainStartChooseCallback(true, MainActivity.this); + dialogFragment.show(getSupportFragmentManager(), "MainStartDialogFragment"); + } + + @Override + public void onError(RongIMClient.ConnectionErrorCode e) { + ToastUtil.show(R.string.net_error + "" + e.toString()); + } + + @Override + public void onDatabaseOpened(RongIMClient.DatabaseOpenStatus code) { + ToastUtil.show(R.string.net_error + "" + code); + } + }); } } From f9b0d33f6e07589c2b0821f8ef660c175eac324b Mon Sep 17 00:00:00 2001 From: 18142669586 <1669783059@qq.com> Date: Fri, 26 Jul 2024 15:39:14 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E5=8D=87=E7=BA=A734=E7=89=88=E6=9C=AC?= =?UTF-8?q?=EF=BC=8C=E4=BB=A5=E5=8F=8A=E8=B0=B7=E6=AD=8C=E5=86=85=E8=B4=AD?= =?UTF-8?q?7.0=E7=89=88=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/src/main/java/com/shayu/phonelive/AppContext.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/com/shayu/phonelive/AppContext.java b/app/src/main/java/com/shayu/phonelive/AppContext.java index 5fdd43c17..55e1bb468 100644 --- a/app/src/main/java/com/shayu/phonelive/AppContext.java +++ b/app/src/main/java/com/shayu/phonelive/AppContext.java @@ -220,7 +220,8 @@ public class AppContext extends CommonAppContext { } CrashSaveBean.getInstance().setStartTime(System.currentTimeMillis()); //注册全局异常捕获 - registerE性格rror(); + + registerError(); registerFirebaseCrash(); LogUtils.start(this); sInstance = this;