Receiver not registered: com.adform.sdk.receivers.ExpandBCReceiver
Closed this issue · 1 comments
almeric commented
Hi,
I'm having issues with AdInlineLW
adviews in a recyclerview. (See attached stacktrace). Unfortunately I'm not able to use the AdformRecyclerViewAdapter
, so I had to roll my own implementation.
What I'm doing is the following:
When updating the recyclerview adapter i'm cacheing all adviews in a hashmap:
private static final Map<Integer, AdInlineLW> mAdViews = new HashMap<>();
Random random = new Random();
int randomId = random.nextInt(6) + 5;
AdInlineLW adView = new AdInlineLW(mContext, randomId);
adView.setId(((BannerRow) item).getAdId());
adView.setMasterTagId(((BannerRow) item).getAdId());
adView.setDebugMode(false);
adView.setSupportedSizes(new AdSize(320, 50), new AdSize(320, 100), new AdSize(320, 250));
adView.addKeyValue(((BannerRow) item).getBannerKey(), ((BannerRow) item).getCategory());
adView.loadAd();
adView.setModalPresentationStyle(AdformEnum.AnimationType.NO_ANIMATION);
mAdViews.put(((BannerRow) item).getPosition(), adView);
The holder for the banner is a simple LinearLayout
.
In onBindViewHolder
I add the addview to the layout:
AdInlineLW adView = mAdViews.get(rowInfo.getPosition());
LinearLayout parent = (LinearLayout) adView.getParent();
// Make TRULY sure the parent has no children
if (parent != null) {
parent.removeAllViews();
}
bannerHolder.mBannerHolder.setVisibility(View.VISIBLE);
bannerHolder.mBannerHolder.addView(adView);
Unfortunately I'm not able to reproduce the issue, I'm only seeing it with a relatively small percentage of our users. If you need any more info, please let me know.
rprunskas commented
If you are still facing this problem, please open a new issue and provide whole source code of your recycler view adapter.