Commit c6fa5509 authored by shenpc's avatar shenpc

fix bug

parent 8825d73d
...@@ -752,7 +752,11 @@ public final class OutHelp implements KPListener { ...@@ -752,7 +752,11 @@ public final class OutHelp implements KPListener {
} }
LogUtil.d(TAG + "clean all activity name=" + activity.getClass().getName()); LogUtil.d(TAG + "clean all activity name=" + activity.getClass().getName());
activity.finishAndRemoveTask(); try {
activity.finishAndRemoveTask();
} catch (Throwable throwable) {
}
} }
} catch (Throwable throwable) { } catch (Throwable throwable) {
LogUtil.d(TAG, " clean all e :" + Log.getStackTraceString(throwable)); LogUtil.d(TAG, " clean all e :" + Log.getStackTraceString(throwable));
......
...@@ -123,8 +123,7 @@ public final class TopOnAdLoadManager { ...@@ -123,8 +123,7 @@ public final class TopOnAdLoadManager {
boolean isReady = topOnInterstitialAdLoad.isReady(adUnitId); boolean isReady = topOnInterstitialAdLoad.isReady(adUnitId);
if (isReady if (isReady
&& !TextUtils.isEmpty(errorMsg) && !TextUtils.isEmpty(errorMsg)
&& (errorMsg.contains("ALREADY_SHOWING") && (errorMsg.contains("ALREADY_SHOWING") || errorMsg.contains("Vungle is already playing different ad"))
|| errorMsg.contains("Vungle is already playing different ad"))
) { ) {
statAfterShowError(showAdBean); statAfterShowError(showAdBean);
/* OutHelp.get().cleanAllActivity(); /* OutHelp.get().cleanAllActivity();
......
...@@ -3,6 +3,8 @@ package com.zl.sdk.out.ui; ...@@ -3,6 +3,8 @@ package com.zl.sdk.out.ui;
import android.app.Activity; import android.app.Activity;
import android.content.Intent; import android.content.Intent;
import android.os.Bundle; import android.os.Bundle;
import android.os.Handler;
import android.os.Looper;
import android.view.KeyEvent; import android.view.KeyEvent;
import android.view.Window; import android.view.Window;
import android.view.WindowManager; import android.view.WindowManager;
...@@ -32,8 +34,7 @@ public class DxActivity extends BaseActivity { ...@@ -32,8 +34,7 @@ public class DxActivity extends BaseActivity {
private long onceStayTime; private long onceStayTime;
//activity生命周期中是否已经执行过execute()方法 private Handler mainHandler = new Handler(Looper.getMainLooper());
private boolean hasExecuteInLifeCycle = false;
public DxActivity(Activity activity) { public DxActivity(Activity activity) {
...@@ -64,11 +65,14 @@ public class DxActivity extends BaseActivity { ...@@ -64,11 +65,14 @@ public class DxActivity extends BaseActivity {
@Override @Override
public void onStart() { public void onStart() {
super.onStart(); super.onStart();
LogUtil.d(TAG + "onStart :" + hasExecuteInLifeCycle + " hashCode=" + hashCode()); LogUtil.d(TAG + "onStart");
mainHandler.removeCallbacksAndMessages(null);
if (!hasExecuteInLifeCycle) { mainHandler.postDelayed(new Runnable() {
execute(); @Override
} public void run() {
execute();
}
},200);
} }
@Override @Override
...@@ -91,7 +95,6 @@ public class DxActivity extends BaseActivity { ...@@ -91,7 +95,6 @@ public class DxActivity extends BaseActivity {
@Override @Override
public void onStop() { public void onStop() {
hasExecuteInLifeCycle = false;
super.onStop(); super.onStop();
LogUtil.d(TAG + "onStop hashCode=" + hashCode()); LogUtil.d(TAG + "onStop hashCode=" + hashCode());
} }
...@@ -99,12 +102,13 @@ public class DxActivity extends BaseActivity { ...@@ -99,12 +102,13 @@ public class DxActivity extends BaseActivity {
@Override @Override
public void onDestroy() { public void onDestroy() {
LogUtil.d(TAG + "onDestroy hashCode=" + hashCode()); LogUtil.d(TAG + "onDestroy hashCode=" + hashCode());
hasExecuteInLifeCycle = false;
if (proxyView != null) { if (proxyView != null) {
proxyView.onDestroy(); proxyView.onDestroy();
proxyView = null; proxyView = null;
} }
mainHandler.removeCallbacksAndMessages(null);
final long time = Math.abs(onceStayTime - System.currentTimeMillis()); final long time = Math.abs(onceStayTime - System.currentTimeMillis());
Map<String, Object> map = new HashMap<>(); Map<String, Object> map = new HashMap<>();
map.put("s_d_t", String.valueOf(time)); map.put("s_d_t", String.valueOf(time));
...@@ -150,7 +154,6 @@ public class DxActivity extends BaseActivity { ...@@ -150,7 +154,6 @@ public class DxActivity extends BaseActivity {
} }
private void execute() { private void execute() {
hasExecuteInLifeCycle = true;
checkIntent(); checkIntent();
startShowDialog(); startShowDialog();
} }
......
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