管灌系统巡查员智能手机App
zuoxiao
2024-10-15 be9bea2335d4e4617844a1603aa624098c84b2a2
app/src/main/java/com/dayu/pipirrapp/MyApplication.java
@@ -2,6 +2,11 @@
import android.app.Application;
import com.dayu.pipirrapp.net.ApiManager;
import com.tencent.bugly.crashreport.CrashReport;
//import cn.jpush.android.api.JPushInterface;
/**
 * author: zuo
 * Date: 2023/12/21
@@ -10,10 +15,28 @@
 */
public class MyApplication extends Application {
    public static MyApplication myApplication;
    public String myTag = "-1";
    public String token;
    @Override
    public void onCreate() {
        super.onCreate();
        myApplication = this;
        ApiManager.init();
//        JPushInterface.setDebugMode(true);
//        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);
            }
        });
    }
}