I implemented interstitial and banner ads on my app. they run well when auto rotation is off. but when auto rotation is turned On, and whenever screen orientation changes, my app starts to show interstitial ads repeatedly, it shows the ads till the device hangs. and don't have any effect of cancelling the ad or backpressing. I have also set the limit for ads as
Ad unit-level: 1 impr / 2 minutes
App-level: 1 impr / 2 minutes
but it doesn't work.
please suggest me a solution for this problem.
Or is it a bug of Admob?
I have written the code as:
@Override
protected void onCreate(Bundle savedInstanceState) {
mInterstitialAd.setAdUnitId("*************");
mInterstitialAd.loadAd(adRequest);
mInterstitialAd.setAdListener(new AdListener(){
public void onAdLoaded(){
mInterstitialAd.show();
}
});
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_home);
}
@Override
protected void onStart() {
super.onStart();
if (mInterstitialAd.isLoaded()) {
mInterstitialAd.show();
}
}