Close Interstitial Ad programmatically

Asked

Viewed 42 times

0

I wanted to close my Interstitial ad after 30 seconds in case the user doesn’t close manually. I tried to close by simulating the back button pressed, but it has no effect.

public void onFinish() {
  Log.d(TAG, "terminou timer pausa 30s");
  dispatchKeyEvent(new KeyEvent(KeyEvent.ACTION_DOWN, KeyEvent.KEYCODE_BACK));
  //rodarvideo();
}

Is it possible to close programmatically? If yes, how do I do?

  • Which AD are you generating? There’s nothing in their documentation?

  • I’m using the same admob, searched and has nothing to quote about closing.

  • I searched and found this same code you’re using, where you call this line of code?

  • There is no native way to close the interstitial programmatically, at least according to official documentation. The most you will achieve is through these "hacks" to simulate the "back" button (which even you have tried), but there are no guarantees that will always work.

  • @Paulo no Finish no countdowntimer

  • @Márciooliveira can’t simulate a click on the close button?

  • The problem is that you do not control the content of the ad’s. Some have close button (which appear in various positions), others a timer, etc. And I believe that the philosophy of ad is to make the user interact with it, so make the app itself close the ad goes against it.

  • I get it. I’ll explain it to the client

Show 3 more comments
No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.