4

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();
        }

    }

screenshot from device

Kshitij Aggarwal
  • 5,287
  • 5
  • 34
  • 41
  • Show your code and layout – William May 26 '15 at 14:22
  • you are saying you have on both banner and inter and that causes the screen to corrupt? is it your layout getting messed up or the pop up inter? – Elltz Jun 02 '15 at 21:37
  • the screen layout is getting messed after I come out of the Interstitial ad to the screen having banner ad. surprisingly the ad looks fine as you can see in the screenshot, only the app layout goes bad. – Kshitij Aggarwal Jun 04 '15 at 04:21
  • I tried your implementation, I created 2 activities, in first one i display interstitialAd, and when closed I moved to second screen and display your banner ads without any problem. If this is the scenario I will share code with you. – Safwan Hijazi Jun 07 '15 at 21:33
  • On which android and play services does this happen? On which device do you see this? – rds Jun 07 '15 at 21:36
  • 2
    This seem some bug with Google Play services and issue only encounter in Lollipop OS. I have some time seen the same issue in Moto G running Lollipop and when I start the Native Google Map the screen has strange behavior. – Vipin Sahu Jun 08 '15 at 10:01
  • Im using Android 5.0 on Motorola X2 with Google Play Services version 7.5.71. I have a Samsung Galaxy S3 with Android 5.0.1 and I dont see this problem in that device – Kshitij Aggarwal Jun 08 '15 at 10:04

0 Answers0