管灌系统巡查员智能手机App
app/src/main/java/com/dayu/pipirrapp/MyApplication.java
@@ -6,7 +6,7 @@
import com.jeremyliao.liveeventbus.LiveEventBus;
import com.tencent.bugly.crashreport.CrashReport;
//import cn.jpush.android.api.JPushInterface;
/**
 * author: zuo
@@ -16,9 +16,11 @@
 */
public class MyApplication extends Application {
    public static MyApplication myApplication;
    //数据库的tag值
    public String myTag = "-1";
    public String token;
    public String userId;
    public String userId;//2024120411461000002
    @Override
    public void onCreate() {
@@ -32,14 +34,15 @@
//        JPushInterface.init(this);
        CrashReport.initCrashReport(getApplicationContext(), "3d4bcf7046", false);
        // 设置全局的UncaughtExceptionHandler
        Thread.setDefaultUncaughtExceptionHandler(new Thread.UncaughtExceptionHandler() {
            @Override
            public void uncaughtException(Thread thread, Throwable ex) {
                // 这里处理未捕获的异常
                CrashReport.postCatchedException(ex);
            }
        });
//        // 设置全局的UncaughtExceptionHandler
//        Thread.setDefaultUncaughtExceptionHandler(new Thread.UncaughtExceptionHandler() {
//            @Override
//            public void uncaughtException(Thread thread, Throwable ex) {
//                Log.e("MyApplication", ex.toString());
//                // 这里处理未捕获的异常
//                CrashReport.postCatchedException(ex);
//            }
//        });
        //设置
        LiveEventBus.config()
//                .lifecycleObserverAlwaysActive(false) // 控制生命周期监听的默认行为