fix:增加异常捕获打印
This commit is contained in:
@@ -0,0 +1,19 @@
|
||||
package com.nnbc123.app.application
|
||||
|
||||
import android.content.Context
|
||||
import android.util.Log
|
||||
|
||||
/**
|
||||
* Created by Max on 2023/12/22 14:49
|
||||
* Desc:
|
||||
**/
|
||||
object ExceptionHandler {
|
||||
fun init(context: Context) {
|
||||
val defaultHandler = Thread.getDefaultUncaughtExceptionHandler()
|
||||
Thread.setDefaultUncaughtExceptionHandler { t, e ->
|
||||
e.printStackTrace()
|
||||
Log.d("ExceptionHandler", "异常捕获:${e}")
|
||||
defaultHandler?.uncaughtException(t, e)
|
||||
}
|
||||
}
|
||||
}
|
@@ -626,6 +626,7 @@ public class XChatApplication extends BaseApp {
|
||||
public void onCreate() {
|
||||
super.onCreate();
|
||||
instance = this;
|
||||
ExceptionHandler.INSTANCE.init(instance);
|
||||
BaseApp.init(this);
|
||||
BasicConfig.INSTANCE.setAppContext(this.getApplicationContext());
|
||||
SharedPreferenceUtils.init(this);
|
||||
|
@@ -8,6 +8,7 @@ import com.nnbc123.core.manager.zego.ZegoEngineManager;
|
||||
import com.nnbc123.core.room.bean.RoomAudioSdkType;
|
||||
import com.nnbc123.core.room.bean.RoomInfo;
|
||||
import com.nnbc123.core.utils.LogUtils;
|
||||
import com.tencent.mm.opensdk.utils.Log;
|
||||
|
||||
import io.agora.rtc2.Constants;
|
||||
|
||||
@@ -29,6 +30,7 @@ public class AudioEngineManager {
|
||||
}
|
||||
|
||||
public void initRtcEngine(EngineType engineType) {
|
||||
Log.d(TAG,"initRtcEngine() engineType:" + engineType);
|
||||
switch (engineType) {
|
||||
case TYPE_ZEGO:
|
||||
this.iAudioEngine = ZegoEngineManager.get();
|
||||
|
Reference in New Issue
Block a user