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!