Commit c6fa5509 authored by shenpc's avatar shenpc

fix bug

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