title: LAYOUT ENCOURAGES ACCIDENTAL CLICKS - INTERSTITIAL ADS:
body: <p>Please any one help Now my app has disable by admob due to wrong interstitial code as</p>
  
  <blockquote>
    <p>"Interstitial ads that load unexpectedly while a user is viewing the
    app’s content".</p>
  </blockquote>
  
  <p>what to do? Please some one correct me...</p>
  
  <pre><code>    import android.os.Bundle;
      import android.view.Window;
      import android.view.WindowManager;
      import android.support.v7.app.AppCompatActivity;
      import android.webkit.WebSettings;
      import android.webkit.WebView;
      import android.webkit.WebViewClient;
  
      import com.google.android.gms.ads.AdListener;
      import com.google.android.gms.ads.AdRequest;
      import com.google.android.gms.ads.AdView;
      import com.google.android.gms.ads.InterstitialAd;
  
      public class a2 extends AppCompatActivity {
  
          AdView mAdView;
          InterstitialAd mInterstitialAd;
          WebView WebViewWithCSS;
  
          @Override
          protected void onCreate(Bundle savedInstanceState) {
              super.onCreate(savedInstanceState); requestWindowFeature(Window.FEATURE_NO_TITLE); getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);
              setContentView(R.layout.activity_a2);
  
              WebViewWithCSS = (WebView)findViewById(R.id.webView);
  
              WebSettings webSetting = WebViewWithCSS.getSettings();
              webSetting.setJavaScriptEnabled(true);
  
              WebViewWithCSS.setWebViewClient(new WebViewClient());
              WebViewWithCSS.loadUrl("file:///android_asset/2.html");
  
              mAdView = (AdView) findViewById(R.id.adView);
              AdRequest adRequest = new AdRequest.Builder()
                      .build();
              mAdView.loadAd(adRequest);
  
              mInterstitialAd = new InterstitialAd(this);
  
              // set the ad unit ID
              mInterstitialAd.setAdUnitId(getString(R.string.interstitial_full_screen));
  
              adRequest = new AdRequest.Builder()
                      .build();
  
              // Load ads into Interstitial Ads
              mInterstitialAd.loadAd(adRequest);
  
              mInterstitialAd.setAdListener(new AdListener() {
                  public void onAdLoaded() {
                      showInterstitial();
                  }
              });
          }
  
          @Override
          public void onPause() {
              if (mAdView != null) {
                  mAdView.pause();
              }
              super.onPause();
          }
  
          @Override
          public void onResume() {
              super.onResume();
              if (mAdView != null) {
                  mAdView.resume();
              }
          }
  
          @Override
          public void onDestroy() {
              if (mAdView != null) {
                  mAdView.destroy();
              }
              super.onDestroy();
          }
  
  
          private void showInterstitial() {
              if (mInterstitialAd.isLoaded()) {
                  mInterstitialAd.show();
              }
          }
      }
  </code></pre>