title: Admob Interstitial Preloading
body: <p>I'm implementing Admob interstitial ads in a button. But it take 3-4 seconds to load the ads, user wrongly click button again and app get crush. How to preload interstitial ads or load instantly when press the button. Here is my code.</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>img_ply.setOnClickListener(new View.OnClickListener() {
  
     @Override
     public void onClick(View v) {
      // TODO Auto-generated method stub
  
  
      mAdView = (AdView) findViewById(R.id.adView);
      mAdView.loadAd(new AdRequest.Builder().build());
  
      mInterstitial.setAdUnitId(getResources().getString(R.string.admob_intertestial_id));
      mInterstitial.loadAd(new AdRequest.Builder().build());
  
      mInterstitial.setAdListener(new AdListener() {
       @Override
       public void onAdLoaded() {
        // TODO Auto-generated method stub
        super.onAdLoaded();
        if (mInterstitial.isLoaded()) {
         mInterstitial.show();
         mInterstitial.setAdListener(new AdListener() {
          @Override
          public void onAdClosed() {
           super.onAdClosed();
           finish();
  
           Intent inttv = new Intent(SingleChannelActivity.this, TvPlay.class);
           inttv.putExtra("url", ChannelUrl);
           startActivity(inttv);
          }
         });
        }else{
         super.onAdLoaded();
  
  
        }
       }
      });
     }
    });</code></pre>
  </div>
  </div>
  </p>