We are using admob interstitial ads in our level based game coded in andengine. Ad is displayed properly when the game is loaded for the first time. However we want to show the ad after every level. It give gives error when the ad is called second time i.e on level over scene. We are using the following code.
"interstitial = new InterstitialAd(this, "123456789");
adRequest = new AdRequest();
interstitial.loadAd(adRequest);
interstitial.setAdListener(ShootBalloonMainActivity.this);"
This is error: Can't create handler inside thread that has not called Looper.prepare()
We have come to conclusion that this is happening as the Main thread is not paused when the ad is shown for second time. So two threads run simultaneously which throws the error. Is that the case? If so, how do we pause the Main thread?