title: My application crash after using Volley lib to retrieve ads Id
body: <p>I modified my project code to retrieve admob id from a server to show admob banner/interstitial using particular value of id by volley lib. Consequently, my application crashes each time the interstitial starts</p>
  <p>The logcat points that &quot;<strong>The ad unit ID must be set on InterstitialAd before loadAd is called.</strong>&quot;</p>
  <p>This warning is caused by</p>
  <pre><code> @Override
          public void onPageStarted(WebView view, String url, Bitmap favicon) {
              if (!isRedirected || INCREMENT_WITH_REDIRECTS) {
                  super.onPageStarted(view, url, favicon);
  
                  webViewCount = webViewCount + 1;
                  if (webViewCount &gt;= ServerClass.SHOW_AD_AFTER_X) {
                      if (ServerClass.SHOW_FULL_SCREEN_AD &amp;&amp; !HIDE_ADS_FOR_PURCHASE) {
                          if (ServerClass.USE_FACEBOOK_ADS) {
                              if (facebookInterstitialAd != null) {
                                  facebookInterstitialAd.loadAd();
                              }
                          } else {
                              if (mInterstitialAd != null) {
                                  final AdRequest fullscAdRequest = new AdRequest.Builder().build();
                                  mInterstitialAd.loadAd(fullscAdRequest);
                              }
                          }
                      }
                  }
              }
          }
      
  </code></pre>
  <p>So when I change it to</p>
  <pre><code>if (mInterstitialAd != null) {
                                  final AdRequest fullscreenAdRequest = new AdRequest.Builder().build();
                                  mInterstitialAd.setAdUnitId(ServerClass.interstitial_full);
                                  mInterstitialAd.loadAd(fullscreenAdRequest);
                              }
  </code></pre>
  <p>I got another warning &quot;<strong>The ad unit ID can only be set once on InterstitialAd.</strong>&quot;</p>
  <p>since setAdUnitId is already used in an if statement in onCreate method:</p>
  <pre><code>
          if (!HIDE_PURCHASE) {
              if (ServerClass.FACEBOOK_ADS) {
                    //CODE
              } else {
                  mInterstitialAd = new InterstitialAd(this);
  
                  mInterstitialAd.setAdUnitId(ServerClass.interstitial_full);
  
                  mInterstitialAd.setAdListener(new AdListener() {
                      public void onAdLoaded() {
  
                          showInterstitial();
                      }
  
                  });
              }
  </code></pre>
  <p>How could I prevent my app from crashing, and why is retrieving data from server would cause that though the data is already present based on Log msg</p>