| | |
| | | import android.view.ViewGroup; |
| | | import android.widget.FrameLayout; |
| | | |
| | | import com.lcjian.library.util.ManifestDataUtil; |
| | | import com.lcjian.library.util.SystemCommon; |
| | | import com.qq.e.ads.nativ.NativeExpressAD; |
| | | import com.weikou.beibeivideo.R; |
| | |
| | | |
| | | // 1.加载广告,先设置加载上下文环境和条件 |
| | | private void loadAd(boolean show) { |
| | | //vivo无广告 |
| | | if ("vivo".equalsIgnoreCase(ManifestDataUtil.getAppMetaData(context, "UMENG_CHANNEL"))) { |
| | | return; |
| | | } |
| | | |
| | | expressAdManager.loadAppExitAd(new ExpressAdManager.IAdLoadListener() { |
| | | @Override |
| | |
| | | fl_advertisement.removeAllViews(); |
| | | } |
| | | }); |
| | | if (adList.get(0).getGdt2() != null) { |
| | | if (adList.get(0).getGdt2().getAdView().getParent() != null) { |
| | | ((ViewGroup) adList.get(0).getGdt2().getAdView().getParent()).removeAllViews(); |
| | | } |
| | | fl_advertisement.addView(adList.get(0).getGdt2().getAdView()); |
| | | } |
| | | } |
| | | } |
| | | |