I'm trying to show banner ads and interstitial ads via admob on different screens of my app. But every time I switch from the activity showing interstitial ad to activity showing banner ad my screen gets corrupted. It works fine when I use only one out of the two.
Seems like an admob issue. Anyone aware of any work around?
Update - Banner Ad
<com.google.android.gms.ads.AdView
android:id="@+id/adView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
ads:adSize="SMART_BANNER"
ads:adUnitId="@string/ad_unit_id"
android:visibility="visible" />
public void onCreate(Bundle instance){
...
mAdView = (AdView) findViewById(R.id.adView);
mAdView.loadAd(new AdRequest.Builder().build());
...
}
Interstitial Ad
public void onCreate(Bundle instance){
...
interstitialAd = new InterstitialAd(this);
interstitialAd.setAdUnitId(getResources().getString(R.string.full_screen_ad_unit_id));
interstitialAd.setAdListener(new AdListener() {
@Override
public void onAdClosed() {
finish();
}
});
requestNewInterstitial();
}
private void requestNewInterstitial() {
AdRequest adRequest = new AdRequest.Builder().build();
interstitialAd.loadAd(adRequest);
}
public void showAd() {
if (interstitialAd.isLoaded()) {
interstitialAd.show();
} else {
finish();
}
}