|
|
@@ -2,6 +2,7 @@ package com.sheep.jiuyan.samllsheep;
|
|
|
|
|
|
import android.app.Activity;
|
|
|
import android.content.Context;
|
|
|
+import android.content.Intent;
|
|
|
import android.os.Bundle;
|
|
|
import android.support.multidex.MultiDex;
|
|
|
|
|
|
@@ -16,6 +17,7 @@ import com.sheep.gamegroup.util.ActivityManager;
|
|
|
import com.sheep.gamegroup.util.AppUtil;
|
|
|
import com.sheep.gamegroup.util.ChannelContent;
|
|
|
import com.sheep.gamegroup.util.ConnectAddress;
|
|
|
+import com.sheep.gamegroup.util.DataUtil;
|
|
|
import com.sheep.gamegroup.util.Jump2View;
|
|
|
import com.sheep.gamegroup.util.LogUtil;
|
|
|
import com.sheep.gamegroup.util.SysAppUtil;
|
|
|
@@ -23,6 +25,9 @@ import com.sheep.gamegroup.util.UMConfigUtils;
|
|
|
import com.sheep.gamegroup.view.activity.LoginAct;
|
|
|
import com.sheep.gamegroup.view.activity.PhoneAct;
|
|
|
import com.sheep.gamegroup.view.activity.SplashAct;
|
|
|
+import com.sheep.jiuyan.samllsheep.service.DownloadService;
|
|
|
+import com.sheep.jiuyan.samllsheep.service.FloatService;
|
|
|
+import com.sheep.jiuyan.samllsheep.service.FloatShotScreenService;
|
|
|
import com.sheep.jiuyan.samllsheep.utils.G;
|
|
|
import com.sheep.jiuyan.samllsheep.utils.SpUtils;
|
|
|
import com.tencent.bugly.Bugly;
|
|
|
@@ -159,7 +164,8 @@ public class SheepApp extends BaseApplication {
|
|
|
LogUtil.println("SheepApp onActivityStarted", mActivityCount);
|
|
|
UMConfigUtils.Event.SHEEP_STARTED.onEvent();
|
|
|
Jump2View.getInstance().startFloat(activity, false);
|
|
|
- Jump2View.getInstance().startShotScreenFloat(activity, false);
|
|
|
+ if(DataUtil.IS_USE_SCREEN_SHOT)
|
|
|
+ Jump2View.getInstance().startShotScreenFloat(activity, false);
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
@@ -182,7 +188,8 @@ public class SheepApp extends BaseApplication {
|
|
|
LogUtil.println("SheepApp onActivityStopped", mActivityCount);
|
|
|
UMConfigUtils.Event.SHEEP_STOPPED.onEvent();
|
|
|
Jump2View.getInstance().startFloat(activity, true);
|
|
|
- Jump2View.getInstance().startShotScreenFloat(activity, true);
|
|
|
+ if(DataUtil.IS_USE_SCREEN_SHOT)
|
|
|
+ Jump2View.getInstance().startShotScreenFloat(activity, true);
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
@@ -195,6 +202,10 @@ public class SheepApp extends BaseApplication {
|
|
|
public void onActivityDestroyed(Activity activity) {
|
|
|
if(mActivityCount == 0) {
|
|
|
LogUtil.println("SheepApp onActivityDestroyed", mActivityCount);
|
|
|
+ stopService(new Intent(SheepApp.this, DownloadService.class));
|
|
|
+ stopService(new Intent(SheepApp.this, FloatService.class));
|
|
|
+ if(DataUtil.IS_USE_SCREEN_SHOT)
|
|
|
+ stopService(new Intent(SheepApp.this, FloatShotScreenService.class));
|
|
|
UMConfigUtils.Event.SHEEP_DESTROYED.onEvent();
|
|
|
}
|
|
|
}
|