Commit 8aea2dfe authored by 赵鹏翔's avatar 赵鹏翔

优化

parent f42fba82
......@@ -125,53 +125,23 @@ class MiyaApplication : BaseApplication() {
registerActivityLifecycleCallbacks(object : ActivityLifecycleCallbacks {
override fun onActivityCreated(activity: Activity, savedInstanceState: Bundle?) {
DensityUtils.setDensity(activity, this@MiyaApplication)
XLog.d(DateUtils.format18(Date()) + " onActivityCreated")
if (!LogFileUtils.isProhibitWrite) {
LogFileUtils.writeLog(
ContextUtils.getContext(),
"\n${DateUtils.format18(Date())}########onActivityCreated() called with: activity = [$activity]\n"
)
}
activityLifeCycleLog(activity,"onActivityCreated()")
}
override fun onActivityStarted(activity: Activity) {
XLog.d(DateUtils.format18(Date()) + " onActivityStarted")
if (!LogFileUtils.isProhibitWrite) {
LogFileUtils.writeLog(
ContextUtils.getContext(),
"\n${DateUtils.format18(Date())}########onActivityStarted() called with: activity = [$activity]\n"
)
}
activityLifeCycleLog(activity,"onActivityStarted()")
}
override fun onActivityResumed(activity: Activity) {
XLog.d(DateUtils.format18(Date()) + " onActivityResumed")
if (!LogFileUtils.isProhibitWrite) {
LogFileUtils.writeLog(
ContextUtils.getContext(),
"\n${DateUtils.format18(Date())}########onActivityResumed() called with: activity = [$activity]\n"
)
}
activityLifeCycleLog(activity,"onActivityResumed()")
}
override fun onActivityPaused(activity: Activity) {
XLog.d(DateUtils.format18(Date()) + " onActivityPaused")
if (!LogFileUtils.isProhibitWrite) {
LogFileUtils.writeLog(
ContextUtils.getContext(),
"\n${DateUtils.format18(Date())}########onActivityPaused() called with: activity = [$activity]\n"
)
}
activityLifeCycleLog(activity,"onActivityPaused()")
}
override fun onActivityStopped(activity: Activity) {
XLog.d(DateUtils.format18(Date()) + " onActivityStopped")
if (!LogFileUtils.isProhibitWrite) {
LogFileUtils.writeLog(
ContextUtils.getContext(),
"\n${DateUtils.format18(Date())}########onActivityStopped() called with: activity = [$activity]\n"
)
}
activityLifeCycleLog(activity,"onActivityStopped()")
}
override fun onActivitySaveInstanceState(activity: Activity, outState: Bundle) {
......@@ -189,17 +159,21 @@ class MiyaApplication : BaseApplication() {
}
override fun onActivityDestroyed(activity: Activity) {
XLog.d(DateUtils.format18(Date()) + " onActivityDestroyed")
if (!LogFileUtils.isProhibitWrite) {
LogFileUtils.writeLog(
ContextUtils.getContext(),
"\n${DateUtils.format18(Date())}########onActivityDestroyed() called with: activity = [$activity]\n"
)
}
activityLifeCycleLog(activity,"onActivityDestroyed()")
}
})
}
private fun activityLifeCycleLog(activity: Activity, lifeName: String) {
XLog.d(DateUtils.format18(Date()) + " $lifeName")
if (!LogFileUtils.isProhibitWrite) {
LogFileUtils.writeLog(
ContextUtils.getContext(),
"\n${DateUtils.format18(Date())}########$lifeName called with: activity = [$activity]\n"
)
}
}
fun resetConfig() {
LocalKeyDataMKManageKit.clearCommonData()
//清除本地订单昨天的流水信息
......
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