Commit 77f091c5 authored by mengcuiguang's avatar mengcuiguang

优化优量汇内存泄漏,更换最新api

parent 7096cfc1
......@@ -36,14 +36,13 @@ public class YlhVideoAdManager extends BaseVideoAd {
if (_inst != null) {
return _inst;
} else {
WeakReference<Activity> activityWeakReference = new WeakReference<>(activity);
_inst = new YlhVideoAdManager(activityWeakReference);
_inst = new YlhVideoAdManager(activity);
return _inst;
}
}
private YlhVideoAdManager(WeakReference<Activity> activity) {
init(activity.get());
private YlhVideoAdManager(Activity activity) {
init(activity);
}
private void init(Activity activity) {
......@@ -53,6 +52,7 @@ public class YlhVideoAdManager extends BaseVideoAd {
@Override
public void onDestroy() {
activity = null;
rewardVideoAD = null;
}
/**
......@@ -132,7 +132,7 @@ public class YlhVideoAdManager extends BaseVideoAd {
}
rewardVideoAD = new RewardVideoAD(activity, YlhAdManager.YLH_AD_APPID, ylhPostId, new RewardVideoADListener() {
rewardVideoAD = new RewardVideoAD(activity, ylhPostId, new RewardVideoADListener() {
@Override
public void onADLoad() {//广告加载成功,可在此回调后进行广告展示,此时广告过期时间确定,可通过RewardVideoAD.getExpireTimestamp()获取
try {
......
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