Commit 6464f500 authored by mengcuiguang's avatar mengcuiguang

代码优化

parent 0d89916e
......@@ -58,6 +58,9 @@ public class MintsApplication extends MultiDexApplication {
// UmengManager.INSTANCE.preInit(this,
// MateUtils.INSTANCE.getAppMetaData(this, "CHANNEL_NAME"));
// 判断应用是否在前台
ForegroundOrBackground.init(this);
// 三方配置
thirdConfig();
}
......@@ -83,8 +86,6 @@ public class MintsApplication extends MultiDexApplication {
TXCSDKService.init(this);
// 判断应用是否在前台
ForegroundOrBackground.init(this);
// PR下载附件
initPRDownloader();
......
......@@ -388,7 +388,6 @@ class MainFragment : LazyLoadBaseFragment(), HomeView, View.OnClickListener, OnR
val mainFirstRecommend =
AppPreferencesManager.get().getBoolean(Constant.MAIN_FIRST_RECOMMEND, false)
if (!mainFirstRecommend) {
// if (mainFirstRecommend) {
AppPreferencesManager.get().put(Constant.MAIN_FIRST_RECOMMEND, true)
Handler(Looper.getMainLooper()).postDelayed({
......
......@@ -78,6 +78,8 @@ public class ForegroundOrBackground implements Application.ActivityLifecycleCall
TextUtils.equals(simpleName, "SplashForeAdActivity") ||
TextUtils.equals(simpleName, "VipActivity")) {
count++;
System.out.println("mcg __>>>>>>>:: onActivityStarted simpleName="+simpleName+" 进入 count=" + count);
return;
}
......@@ -91,11 +93,16 @@ public class ForegroundOrBackground implements Application.ActivityLifecycleCall
}
}
count++;
System.out.println("mcg __>>>>>>>:: onActivityStarted simpleName="+simpleName+" 进入 count=" + count);
}
@Override
public void onActivityStopped(Activity activity) {
String simpleName = activity.getClass().getSimpleName();
count--;
System.out.println("mcg __>>>>>>>:: onActivityStopped simpleName="+simpleName+" 关闭 count=" + count);
if (count < 0) {
count = 0;
}
......
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