0

i had success Implementation interstitial ads admob but i have 1 problem, why interstitial ads always show every second on my app, so i cannot play my app because this interstitial ads

any want help me how to make interstitial ads show only 1 interstitial ads every app lauch

here my code on my app Activity :

public class Activity extends Activity implements AdListener {
    WebView mWebView;
    private InterstitialAd interstitial;

    .......

    interstitial = new InterstitialAd(this, "a15xxxxxxxxxx");
    AdRequest adRequest = new AdRequest();
    interstitial.loadAd(adRequest);
    interstitial.setAdListener(this);

    .......

    public void onReceiveAd(Ad ad) {
          Log.d("OK", "Received ad");
          if(interstitial.isReady()) {
             interstitial.show();
          }
    }
flx
  • 14,146
  • 11
  • 55
  • 70
lostkids
  • 1
  • 1

2 Answers2

1

Migrate from AdMob to google-play-services, AdMob is deprecated

You should show your ad if .isLoaded()

if (interstitial.isLoaded()) {
  interstitial.show();
} else {
  Log.d(LOG_TAG, "Interstitial ad was not ready to be shown.");
}

Here is an example for Interstitial ads

VenomVendor
  • 15,064
  • 13
  • 65
  • 96
  • Thanks for your respone but i'm not success add Interstitial ad with AdMob to google-play-services. i use eclipse – lostkids Feb 28 '14 at 03:47
0

Your problem may well be caused by you showing your ad as soon as it is received (ie onAdReceived). For interstitials you should show the ad at a natural break point in your app instead.

William
  • 20,150
  • 8
  • 49
  • 91