管灌系统巡查员智能手机App
zuoxiao
2025-01-18 b3e7f379e72111f55a28c302804702ee7c66bfa2
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
package com.dayu.pipirrapp;
 
import android.app.Application;
 
import com.dayu.pipirrapp.net.ApiManager;
import com.jeremyliao.liveeventbus.LiveEventBus;
import com.tencent.bugly.crashreport.CrashReport;
 
 
 
/**
 * author: zuo
 * Date: 2023/12/21
 * Time: 17:41
 * 备注:
 */
public class MyApplication extends Application {
    public static MyApplication myApplication;
    //数据库的tag值
    public String myTag = "-1";
    public String token;
    public String userId;//2024120411461000002
 
 
    @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) {
//                Log.e("MyApplication", ex.toString());
//                // 这里处理未捕获的异常
//                CrashReport.postCatchedException(ex);
//            }
//        });
        //设置
        LiveEventBus.config()
//                .lifecycleObserverAlwaysActive(false) // 控制生命周期监听的默认行为
                .autoClear(true); // 设置是否自动清理未使用的订阅
    }
}