Commit 6eada0c7 authored by mengcuiguang's avatar mengcuiguang

代码优化

parent 356fd38e
......@@ -54,13 +54,11 @@ public class MintsApplication extends MultiDexApplication {
super.onCreate();
mContext = this.getApplicationContext();
// 友盟SDK预初始化函数
// preInit预初始化函数耗时极少,不会影响App首次冷启动用户体验
UmengManager.INSTANCE.preInit(this,
MateUtils.INSTANCE.getAppMetaData(this, "CHANNEL_NAME"));
// // 友盟SDK预初始化函数
// // preInit预初始化函数耗时极少,不会影响App首次冷启动用户体验
// UmengManager.INSTANCE.preInit(this,
// MateUtils.INSTANCE.getAppMetaData(this, "CHANNEL_NAME"));
// 判断应用是否在前台
ForegroundOrBackground.init(this);
// 三方配置
thirdConfig();
......@@ -80,6 +78,8 @@ public class MintsApplication extends MultiDexApplication {
if (AppPreferencesManager.INSTANCE.get()
.getBoolean(Constant.LOAN_PERMISSION_FLAG, true)) return;
// 判断应用是否在前台
ForegroundOrBackground.init(this);
initMiitHelper();
......@@ -87,7 +87,7 @@ public class MintsApplication extends MultiDexApplication {
TXCSDKService.init(this);
TalkingDataManager.INSTANCE.init(this);
// TalkingDataManager.INSTANCE.init(this);
// PR下载附件
initPRDownloader();
......@@ -95,8 +95,8 @@ public class MintsApplication extends MultiDexApplication {
//logger
BindLogger();
UmengManager.INSTANCE.initUm(this,
MateUtils.INSTANCE.getAppMetaData(this, "CHANNEL_NAME"));
// UmengManager.INSTANCE.initUm(this,
// MateUtils.INSTANCE.getAppMetaData(this, "CHANNEL_NAME"));
// bugly
CrashReport.initCrashReport(this, "d035276c5b", BuildConfig.DEBUG);
......
......@@ -15,29 +15,29 @@ object TalkingDataManager {
fun init(application:Application) {
try {
//打开日志
TCAgent.LOG_ON = BuildConfig.LOG_DEBUG
/**
* 动态获取渠道ID(类似友盟)
* AppID说是xml文件里的密钥?
*/
TCAgent.init(application, APP_KEY
, MateUtils.getAppMetaData(application, "CHANNEL_NAME"))
/**
* true-开启自动捕获错误
*/
TCAgent.setReportUncaughtExceptions(true)
} catch (e: Exception) {
e.printStackTrace()
}
// try {
// //打开日志
// TCAgent.LOG_ON = BuildConfig.LOG_DEBUG
// /**
// * 动态获取渠道ID(类似友盟)
// * AppID说是xml文件里的密钥?
// */
// TCAgent.init(application, APP_KEY
// , MateUtils.getAppMetaData(application, "CHANNEL_NAME"))
// /**
// * true-开启自动捕获错误
// */
// TCAgent.setReportUncaughtExceptions(true)
// } catch (e: Exception) {
// e.printStackTrace()
// }
}
fun onResume(cxt:Context,name:String){
TCAgent.onPageStart(cxt, name)
// TCAgent.onPageStart(cxt, name)
}
fun onPause(cxt:Context,name:String){
TCAgent.onPageEnd(cxt, name)
// TCAgent.onPageEnd(cxt, name)
}
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment