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() {
|
public void onCreate() {
|
||||||
super.onCreate();
|
super.onCreate();
|
||||||
instance = this;
|
instance = this;
|
||||||
|
ExceptionHandler.INSTANCE.init(instance);
|
||||||
BaseApp.init(this);
|
BaseApp.init(this);
|
||||||
BasicConfig.INSTANCE.setAppContext(this.getApplicationContext());
|
BasicConfig.INSTANCE.setAppContext(this.getApplicationContext());
|
||||||
SharedPreferenceUtils.init(this);
|
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.RoomAudioSdkType;
|
||||||
import com.nnbc123.core.room.bean.RoomInfo;
|
import com.nnbc123.core.room.bean.RoomInfo;
|
||||||
import com.nnbc123.core.utils.LogUtils;
|
import com.nnbc123.core.utils.LogUtils;
|
||||||
|
import com.tencent.mm.opensdk.utils.Log;
|
||||||
|
|
||||||
import io.agora.rtc2.Constants;
|
import io.agora.rtc2.Constants;
|
||||||
|
|
||||||
@@ -29,6 +30,7 @@ public class AudioEngineManager {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void initRtcEngine(EngineType engineType) {
|
public void initRtcEngine(EngineType engineType) {
|
||||||
|
Log.d(TAG,"initRtcEngine() engineType:" + engineType);
|
||||||
switch (engineType) {
|
switch (engineType) {
|
||||||
case TYPE_ZEGO:
|
case TYPE_ZEGO:
|
||||||
this.iAudioEngine = ZegoEngineManager.get();
|
this.iAudioEngine = ZegoEngineManager.get();
|
||||||
|
Reference in New Issue
Block a user