You have created a local variable in your onCreate()
and assigned the InterstitialAd
instance to it:
InterstitialAd interstitial = new InterstitialAd(this);
This has nothing to do with the field in your class, thus when you call displayInterstitial()
and reference the field in your class ... it's null
Also worth noting is that you're doing the same thing with AdView
.