Good day! Tell me, please, how to solve this problem. There is an application, when you exit it, you need to show admob interstitial banner.

I do it like this:

@Override public boolean onKeyDown(int keyCode, KeyEvent event) { if (keyCode == KeyEvent.KEYCODE_BACK && event.getRepeatCount() == 0) { AdRequest adRequestInter = new AdRequest.Builder().build(); mInterstitialAd.setAdListener(new AdListener() { @Override public void onAdLoaded() { mInterstitialAd.show(); } }); mInterstitialAd.loadAd(adRequestInter); return true; } return super.onKeyDown(keyCode, event); }` 

In this case, the ad is shown, but after it is closed, the user remains in the application, it’s necessary that if he closes the ad, the exit from the application should occur. Thanks in advance for the answer!

    2 answers 2

    So, according to Google's rules, is it forbidden to display ads when you exit the application?

    Invalid interstitial ad placement methods

      there should be an event raised after the announcement is closed, and then close or you can simply close the application by timer, i.e. set the timer with the exit function after n seconds and turned on the ad