Explorar el Código

download in splash bug

billyyoyo hace 6 años
padre
commit
3bcfa03142

+ 3 - 3
app/src/main/java/com/sheep/gamegroup/view/activity/SplashAct.java

@@ -268,8 +268,9 @@ public class SplashAct extends BaseActivity {
             case R.id.splash_video_view:
             case R.id.splash_video_view:
                 if (ad != null) {
                 if (ad != null) {
                     mHandler.removeMessages(0);
                     mHandler.removeMessages(0);
-                    goLink = true;
-                    AdHelper.goAdLink(this, ad);
+                    if (!AdHelper.goAdLink(this, ad)) {
+                        goLink = true;
+                    }
                 } else {
                 } else {
                     sendHandlerMessages(10);
                     sendHandlerMessages(10);
                 }
                 }
@@ -280,7 +281,6 @@ public class SplashAct extends BaseActivity {
     private void sendHandlerMessages(int time) {
     private void sendHandlerMessages(int time) {
         if (jumped) return;
         if (jumped) return;
         try {
         try {
-            new Exception("Splash go to next").printStackTrace();
             if (timer != null) {
             if (timer != null) {
                 timer.clear();
                 timer.clear();
                 timer = null;
                 timer = null;

+ 6 - 4
app/src/main/java/com/sheep/gamegroup/view/activity/helper/AdHelper.java

@@ -36,13 +36,14 @@ import static com.sheep.jiuyan.samllsheep.utils.ClassFileHelper.DIR;
 
 
 public class AdHelper {
 public class AdHelper {
 
 
-    public static void goAdLink(Activity activity, SheepAd advertising) {
+    // 返回true 为apk下载
+    public static boolean goAdLink(Activity activity, SheepAd advertising) {
         if (TextUtils.isEmpty(SpUtils.getToken(SheepApp.getInstance()))) {
         if (TextUtils.isEmpty(SpUtils.getToken(SheepApp.getInstance()))) {
             Jump2View.getInstance().goLoginView(activity, null);
             Jump2View.getInstance().goLoginView(activity, null);
             if (activity instanceof SplashAct) {
             if (activity instanceof SplashAct) {
                 activity.finish();
                 activity.finish();
             }
             }
-            return;
+            return false;
         }
         }
         if (advertising.getJump_type() == 1) {
         if (advertising.getJump_type() == 1) {
             if (advertising.getJump_form() == 1) {
             if (advertising.getJump_form() == 1) {
@@ -51,7 +52,7 @@ public class AdHelper {
                 Jump2View.getInstance().goWeb(activity, advertising.getJump_url());
                 Jump2View.getInstance().goWeb(activity, advertising.getJump_url());
             }
             }
             AdHelper.stat(advertising.getAd_id(), 2);
             AdHelper.stat(advertising.getAd_id(), 2);
-            return;
+            return false;
         } else if (advertising.getJump_type() == 2) {
         } else if (advertising.getJump_type() == 2) {
             if(advertising.getJump_form() == 1) {
             if(advertising.getJump_form() == 1) {
                 String fileName = FileUtil.getLastSplitEnd(advertising.getJump_url(), '/');
                 String fileName = FileUtil.getLastSplitEnd(advertising.getJump_url(), '/');
@@ -62,9 +63,10 @@ public class AdHelper {
                 Jump2View.getInstance().goWeb(activity, advertising.getJump_url());
                 Jump2View.getInstance().goWeb(activity, advertising.getJump_url());
             }
             }
             AdHelper.stat(advertising.getAd_id(), 3);
             AdHelper.stat(advertising.getAd_id(), 3);
-            return;
+            return advertising.getJump_form() == 1;
         }
         }
         CommonUtil.getInstance().clickAd(activity, advertising.getId(), advertising.getLink_type(), advertising.getLink_id());
         CommonUtil.getInstance().clickAd(activity, advertising.getId(), advertising.getLink_type(), advertising.getLink_id());
+        return false;
     }
     }
 
 
     public static void stat(long adId, int type) {
     public static void stat(long adId, int type) {