title: Crash when making Mopub ad banner visible
body: <p>I noticed that sometimes have crashes in my Android app while displaying an ad layout using Mopub SDK.
  I've never been able to reproduce this issue and it never happened on my devices.</p>
  
  <p>Here is the layout containing the ad banner:</p>
  
  <pre><code>&lt;LinearLayout 
      android:id="@+id/layout_ads"
      android:layout_width="match_parent"
      android:layout_height="wrap_content"
      android:visibility="gone"
  &gt;   
  
      &lt;View
          android:layout_width="fill_parent"
          android:layout_height="1dp"
          android:background="@color/list_divider"
      /&gt;
  
      &lt;com.mopub.mobileads.MoPubView
          android:id="@+id/adview"
          android:layout_width="fill_parent"
          android:layout_height="@dimen/ad_height"
      /&gt;        
  &lt;/LinearLayout&gt;
  </code></pre>
  
  <p>Here is where the crash happens:</p>
  
  <pre><code>View adsLayout = null;
  @Override
  protected void onResume() {
    super.onResume();
    ...
    adsLayout = findViewById(R.id.layout_ads);
    ...
    if (adsLayout != null)
       adsLayout.setVisibility(View.GONE);
    ...
  }
  
  @Override
  public void onBannerLoaded(MoPubView arg0) {
      if (adsLayout != null)
          adsLayout.setVisibility(View.VISIBLE);
  }
  </code></pre>
  
  <p>And here is the error bothering me:</p>
  
  <pre><code>java.lang.NullPointerException
         at android.webkit.WebViewClassic.requestFocus(WebViewClassic.java:6997)
         at android.webkit.WebView.requestFocus(WebView.java:2044)
         at android.view.ViewGroup.onRequestFocusInDescendants(ViewGroup.java:2477)
         at android.view.ViewGroup.requestFocus(ViewGroup.java:2433)
         at android.view.ViewGroup.onRequestFocusInDescendants(ViewGroup.java:2477)
         at android.view.ViewGroup.requestFocus(ViewGroup.java:2433)
         at android.view.ViewGroup.onRequestFocusInDescendants(ViewGroup.java:2477)
         at android.view.ViewGroup.requestFocus(ViewGroup.java:2433)
         at android.view.ViewGroup.onRequestFocusInDescendants(ViewGroup.java:2477)
         at android.view.ViewGroup.requestFocus(ViewGroup.java:2433)
         at android.view.ViewGroup.onRequestFocusInDescendants(ViewGroup.java:2477)
         at android.view.ViewGroup.requestFocus(ViewGroup.java:2433)
         at android.view.View.requestFocus(View.java:6487)
         at android.view.View.requestFocus(View.java:6466)
         at android.view.ViewRootImpl.focusableViewAvailable(ViewRootImpl.java:2609)
         at android.view.ViewGroup.focusableViewAvailable(ViewGroup.java:708)
         at android.view.ViewGroup.focusableViewAvailable(ViewGroup.java:708)
         at android.view.ViewGroup.focusableViewAvailable(ViewGroup.java:708)
         at android.view.ViewGroup.focusableViewAvailable(ViewGroup.java:708)
         at android.view.View.setFlags(View.java:8377)
         at android.view.View.setVisibility(View.java:5575)
         at myapp.MyActivity.onBannerLoaded(MyActivity.java:129)
         at com.mopub.mobileads.MoPubView.adLoaded(MoPubView.java:247)
         at com.mopub.mobileads.MoPubView.nativeAdLoaded(MoPubView.java:287)
         at com.mopub.mobileads.CustomEventBannerAdapter.onBannerLoaded(CustomEventBannerAdapter.java:100)
         at com.mopub.mobileads.GoogleAdMobBanner.onReceiveAd(GoogleAdMobBanner.java:170)
         at com.google.ads.internal.d.E(SourceFile:1180)
         at com.google.ads.internal.c$e.run(SourceFile:214)
         at android.os.Handler.handleCallback(Handler.java:615)
         at android.os.Handler.dispatchMessage(Handler.java:92)
         at android.os.Looper.loop(Looper.java:213)
         at android.app.ActivityThread.main(ActivityThread.java:4788)
         at java.lang.reflect.Method.invokeNative(Method.java)
         at java.lang.reflect.Method.invoke(Method.java:511)
         at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:789)
         at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:556)
         at dalvik.system.NativeStart.main(NativeStart.java)
  </code></pre>
  
  <p>Any idea about this issue?</p>