title: Waiting for Admob interstitial ad to load
body: <p>I want to show an Admob ad whenever the user tries for the first time to exit the app, problem is that when the user does that Admob ad might not be completely loaded, so when it loads it could display when the user is already using some other thing, which doesn't offer a good user experience and it's maybe even against the conditions google sets for using Admob ads.</p>
  
  <p>I've tried to do the previous with the following code, hoping that in the free times the app may have between checking that it's loading and letting the app to sleep for a little time it would keep on loading the add.</p>
  
  <pre><code>            while (interstitialAds.isLoading())
              {
                  try 
                  {
                      Thread.sleep(10);
                  }
                  catch (InterruptedException e) 
                  {
                      e.printStackTrace();
                  }
              }
  </code></pre>
  
  <p>But it just keeps on using the whole CPU for the while loop.</p>
  
  <p>Any idea on how to be able to code that if the ad is still loading it must wait until it's loaded?</p>