Source:
<code>void requestBannerAd(@NonNull Context context, @NonNull String appId, @NonNull AdSize adSize) { adLayout = new RelativeLayout(context) { @Override protected void onAttachedToWindow() { super.onAttachedToWindow(); attach(); } @Override protected void onDetachedFromWindow() { super.onDetachedFromWindow(); detach(); } }; int adLayoutHeight = adSize.getHeightInPixels(context); if (adLayoutHeight <= 0) { float density = context.getResources().getDisplayMetrics().density; adLayoutHeight = Math.round(mAdConfig.getAdSize().getHeight() * density); } RelativeLayout.LayoutParams adViewLayoutParams = new RelativeLayout.LayoutParams(adSize.getWidthInPixels(context), adLayoutHeight); adLayout.setLayoutParams(adViewLayoutParams); Log.d(TAG, "requestBannerAd: " + this); mPendingRequestBanner = true; VungleInitializer.getInstance() .initialize( appId, context.getApplicationContext(), new VungleInitializer.VungleInitializationListener() { @Override public void onInitializeSuccess() { loadBanner(); } @Override public void onInitializeError(String errorMessage) { Log.d(TAG, "SDK init failed: " + VungleBannerAdapter.this); VungleListener listener = getVungleListener(); mVungleManager.removeActiveBannerAd(placementId); if (mPendingRequestBanner && listener != null) { listener.onAdFailedToLoad(AdRequest.ERROR_CODE_INTERNAL_ERROR); } <START> } <END> }); }</code><technical_language>@joshuajplagonera @ericleich I belive important call mVungleManager.removeActiveBannerAd(placementId, vungleBannerAd); everywhere, for cleanLeakedBannerAdapters() destroyed in case. reason is previously VungleBannerAdapter for placementId call safe. VungleBannerAdapters ask for mVungleManager.removeActiveBannerAd(placementId); some callback delayed delivering in cases. observer refresh adapter instance get onDestroy() call reason for setLayout() call 'if (adView == mAdLayout.get()) {' check</technical_language>

Target:
void requestBannerAd(@NonNull Context context, @NonNull String appId, @NonNull AdSize adSize) { adLayout = new RelativeLayout(context) { @Override protected void onAttachedToWindow() { super.onAttachedToWindow(); attach(); } @Override protected void onDetachedFromWindow() { super.onDetachedFromWindow(); detach(); } }; int adLayoutHeight = adSize.getHeightInPixels(context); if (adLayoutHeight <= 0) { float density = context.getResources().getDisplayMetrics().density; adLayoutHeight = Math.round(mAdConfig.getAdSize().getHeight() * density); } RelativeLayout.LayoutParams adViewLayoutParams = new RelativeLayout.LayoutParams(adSize.getWidthInPixels(context), adLayoutHeight); adLayout.setLayoutParams(adViewLayoutParams); Log.d(TAG, "requestBannerAd: " + this); mPendingRequestBanner = true; VungleInitializer.getInstance() .initialize( appId, context.getApplicationContext(), new VungleInitializer.VungleInitializationListener() { @Override public void onInitializeSuccess() { loadBanner(); } @Override public void onInitializeError(String errorMessage) { Log.d(TAG, "SDK init failed: " + VungleBannerAdapter.this); VungleListener listener = getVungleListener(); mVungleManager.removeActiveBannerAd(placementId, vungleBannerAd); if (mPendingRequestBanner && listener != null) { listener.onAdFailedToLoad(AdRequest.ERROR_CODE_INTERNAL_ERROR); } } }); }