• 11
name

A PHP Error was encountered

Severity: Notice

Message: Undefined index: userid

Filename: views/question.php

Line Number: 191

Backtrace:

File: /home/prodcxja/public_html/questions/application/views/question.php
Line: 191
Function: _error_handler

File: /home/prodcxja/public_html/questions/application/controllers/Questions.php
Line: 433
Function: view

File: /home/prodcxja/public_html/questions/index.php
Line: 315
Function: require_once

I want to close full screen interstitial ads after some period of time like 10 seconds. How it can be possible through code?

      • 2
    • As per i know, you can not do this. Because there are not any methods available to hide or close ads programetically. User must need to press back or close ads. But you can achieve this by programetically fire hardware back button event.

You can fire the back button event automatically after some delay like this

Handler handler = new Handler();
handler.postDelayed(new Runnable() {
   @Override
   public void run() {
      this.dispatchKeyEvent(new KeyEvent(KeyEvent.ACTION_DOWN, KeyEvent.KEYCODE_BACK));
   }
}, 10000); // 10seconds delay
  • 1
Reply Report