The interstitial takes time to load. You're checking to see if it's ready directly after loading it, so it definitely won't be ready yet. Check your logcat output, you'll probably see that "Interstitial ad was not ready to be shown."
message that you logged.
The interstitial won't be ready until the onReceiveAd()
callback is invoked. You can safely place interstitialAd.show()
inside the onReceiveAd()
callback and the interstitial will show immediately.
Another use case might be you want to show an interstitial at a later time, such as the end of a game level. In which case, you would preload the interstitial at the start of the level, and consult the isReady
flag at the end of the level to see if the interstitial is ready yet.