title: NullPointerException in onResume, related to AdMob but no idea why
body: <p>I'm getting a nullpointer exception in the following code in my application :</p>
  
  <pre><code>@Override
  protected void onResume() {
      super.onResume();    //To change body of overridden methods use File | Settings | File Templates.
  
      // Create the adView
      adView = new AdView(this, AdSize.BANNER, MY_AD_UNIT_ID);
  
      LinearLayout layout = (LinearLayout) findViewById(R.id.ad_layout);
  
      // Add the adView to it
      layout.addView(adView); //NullPointerException here
  
      // Initiate a generic request to load it with an ad
      adView.loadAd(new AdRequest());
  
  
      SharedPreferences sp = PreferenceManager.getDefaultSharedPreferences(this);
      boolean isButtonLabelsEnabled = sp.getBoolean("isButtonLabelsEnabled", false);
      if (!isButtonLabelsEnabled) {
          stripLabels();
      } else {
          setContentView(R.layout.languageselection);
      }
  }
  </code></pre>
  
  <p>I can't replicate this issue, I've played around with all the features in my app on both the emulator, a galaxy S2 device, and a ZTE blade but I can't find any issues.</p>
  
  <p>I'm getting a lot of users report this, but they don't give any indication to why, just that it forces close when they try to open it.</p>
  
  <p>Perhaps I'm not using the android life-cycle correctly?</p>
  
  <p>As a workaround, I've wrapped the AdMob stuff in a try/catch so it can pass through.</p>
  
  <p>Any ideas?</p>