From 0a1336cd2b95126d66d6f3126cb48a446cdbfad1 Mon Sep 17 00:00:00 2001 From: admin <weikou2014> Date: 星期三, 22 十二月 2021 10:56:46 +0800 Subject: [PATCH] 抖音相关SDK集成 --- app/src/com/hanju/video/app/util/ui/ExitDialog.java | 16 ++++++++++------ 1 files changed, 10 insertions(+), 6 deletions(-) diff --git a/app/src/com/hanju/video/app/util/ui/ExitDialog.java b/app/src/com/hanju/video/app/util/ui/ExitDialog.java index d2ac7ee..013786a 100644 --- a/app/src/com/hanju/video/app/util/ui/ExitDialog.java +++ b/app/src/com/hanju/video/app/util/ui/ExitDialog.java @@ -8,15 +8,14 @@ import android.widget.FrameLayout; import android.widget.TextView; -import com.hanju.video.app.entity.ad.AdPositionEnum; import com.hanju.lib.library.util.SystemCommon; -import com.qq.e.ads.nativ.NativeADDataRef; -import com.qq.e.ads.nativ.NativeExpressAD; import com.hanju.video.app.R; +import com.hanju.video.app.entity.ad.AdPositionEnum; import com.hanju.video.app.entity.ad.ExpressAdContainer; import com.hanju.video.app.util.ad.AdUtil; import com.hanju.video.app.util.ad.ExpressAdManager; import com.hanju.video.app.util.ad.ExpressAdManager.IAdEventListener; +import com.qq.e.ads.nativ.NativeExpressAD; import java.util.List; @@ -46,7 +45,11 @@ public Builder(Activity context) { this.context = context; - expressAdManager = new ExpressAdManager(AdUtil.getAdType(context, AdPositionEnum.exitApp), context); + try { + expressAdManager = new ExpressAdManager(AdUtil.getAdType(context, AdPositionEnum.exitApp), context); + } catch (Exception e) { + e.printStackTrace(); + } } @@ -139,12 +142,13 @@ return dialog; } - NativeADDataRef adDataRef; - private NativeExpressAD nativeExpressAD; // 1.鍔犺浇骞垮憡锛屽厛璁剧疆鍔犺浇涓婁笅鏂囩幆澧冨拰鏉′欢 private void loadAd() { + if (expressAdManager == null) { + return; + } expressAdManager.loadAppExitAd(new ExpressAdManager.IAdLoadListener() { @Override -- Gitblit v1.8.0