Sample Android project showcasing how to build a mediation adapter or custom event for the Google Mobile Ads SDK.
Apache License 2.0
244
stars
198
forks
source link
ClassCastException: com.google.ads.mediation.chartboost.ChartboostAdapter cannot be cast to com.google.android.gms.ads.mediation.OnContextChangedListener #95
I believe ChartboostAdapter should implement OnContextChangedListener with an empty implementation of onContextChanged(Context c), otherwise code like this will throw the above exception:
@Override
public void onResume() {
super.onResume();
Chartboost.onResume(this);
if (rewardedVideoAd!=null) rewardedVideoAd.resume(MainActivity.this);
}
I believe ChartboostAdapter should implement OnContextChangedListener with an empty implementation of onContextChanged(Context c), otherwise code like this will throw the above exception:
Note that is code is a mix of what there is already in your sample (rewardedVideoAd.resume), and what https://developers.google.com/admob/android/mediation/chartboost recommends doing (Chartboost.onResume).