Programmatically close an interstitial ad

前端 未结 4 2057
离开以前
离开以前 2020-12-10 14:23

I want to make sure that interstitial ads on Android, using the Android AdMob SDK, can be closed. After some research, it seems to me that this is not possible due to the ad

4条回答
  •  青春惊慌失措
    2020-12-10 15:04

    It's going to be a very late answer but I faced similar issue. A trick can be to call the back button event programmatically.

    this.dispatchKeyEvent(new KeyEvent(KeyEvent.ACTION_DOWN, KeyEvent.KEYCODE_BACK));

    As whenever you press on back button the interstitial ad is closed so firing the back button event will eventually close the interstitial ad. Rest depends on the requirement.

提交回复
热议问题