Commit 852d2f43 authored by mengcuiguang's avatar mengcuiguang

bug优化

parent 36ad682f
......@@ -119,9 +119,16 @@ public class ShanhuVedioAdManager implements ShanhuVedioAdManagerView {
taskTypes.add(taskType);
int ret = mCoinManager.GetTasks(coinRequestInfo, taskTypes, coin, coinTaskTypes);
if (ret != ErrorCode.EC_SUCCESS) {
if (activity != null) {
activity.runOnUiThread(new Runnable() {
@Override
public void run() {
if (shanhuVedioAdListener != null) {
shanhuVedioAdListener.shanhuVedioAdFail();
}
}
});
}
return;
}
......@@ -157,18 +164,33 @@ public class ShanhuVedioAdManager implements ShanhuVedioAdManagerView {
}
} catch (Throwable t) {
t.printStackTrace();
if (activity != null) {
activity.runOnUiThread(new Runnable() {
@Override
public void run() {
if (shanhuVedioAdListener != null) {
LogUtil.d(TAG, "shanhu Throwable");
shanhuVedioAdListener.shanhuVedioAdFail();
}
}
});
}
}
if (!showAdFlag) {
if (activity != null) {
activity.runOnUiThread(new Runnable() {
@Override
public void run() {
if (shanhuVedioAdListener != null) {
LogUtil.d(TAG, "no Ad show");
shanhuVedioAdListener.shanhuVedioAdFail();
}
}
});
}
}
}
}.start();
}
......@@ -191,24 +213,22 @@ public class ShanhuVedioAdManager implements ShanhuVedioAdManagerView {
}
private List<AdMetaInfo> gotRewardVedio(int adId, List<Integer> styleId) {
if (activity != null) {
activity.runOnUiThread(new Runnable() {
@Override
public void run() {
mRewardVedio = new RewardVideo();
List<AdID> list = new ArrayList<>();
list.add(new AdID(adId, 968, 300));
if (activity != null) {
mRewardVedio.load(new RewardVideo.RVListener() {
@Override
public void loaded() {
activity.runOnUiThread(new Runnable() {
@Override
public void run() {
if (mRewardVedio != null) {
mRewardVedio.showAD();
}
TrackManager.getInstance().addCallImp(Constant.AD_SOURCE_SHANHU, Constant.EVENT_TYPE_ZERO, "", "");
}
});
LogUtil.d(TAG, "gotRewardVedio loaded");
}
......@@ -261,6 +281,9 @@ public class ShanhuVedioAdManager implements ShanhuVedioAdManagerView {
}
}
}, activity, new AdID(adId, 968, 300));
}
});
}
return null;
......
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