Mohammad Abu Hmead Mohammad Abu Hmead - 1 year ago 81
Android Question

How to create android Ad Interstitial?

How to create Interstitial ad in my android app, I tried many blogs but no one give the step by step solution.
- Should I edit something on adMob site? I created site from ad sit/app option under Sites & Apps tab.
-I used this code:

interstitial = new InterstitialAd(this, "MyAdMobID");
// Set Ad Listener to use the callbacks below
// Create ad request
AdRequest adRequest = new AdRequest();
// Begin loading your interstitial

Kind Regards in Advance.


Answer Source

Using the last Android framework, I figured out that I need to call the load() function each time the ad is closed.

import android.os.Handler;
import android.os.Looper;

class MyActivity extends Activity implements AdListener {
  private InterstitialAd adView;  // The ad
  private Handler mHandler;       // Handler to display the ad on the UI thread
  private Runnable displayAd;     // Code to execute to perform this operation

  public void onCreate(Bundle savedInstanceState) {
    adView = new InterstitialAd(mContext);
    mHandler = new Handler(Looper.getMainLooper());
    displayAd = new Runnable() {
      public void run() {  
        runOnUiThread(new Runnable() { 
          public void run() { 
            if (adView.isLoaded()) {

  public void onAdClosed() {
    loadAd(); // Need to reload the Ad when it is closed.

  void loadAd() {
    AdRequest adRequest = new AdRequest.Builder()

    // Load the adView object witht he request

  //Call displayInterstitial() once you are ready to display the ad.
  public void displayInterstitial() {
    mHandler.postDelayed(displayAd, 1);
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download