title: Webview causing blackening of background images of various elements on page
body: <p>The banner ads were working all good till today. I noticed there is flickering happening everytime the animation happens inside banner ad.</p>
  <p>This is affecting the background regions of all elements inside Fragment/Activity wherever AdMob Fragment is imported and loading</p>
  <pre><code>
  class AdBFiller : Fragment() {
      private lateinit var mAdView: AdView
      private val mAppUnitId: String = &quot;ad-code&quot;
      var fragContext: Context? = null
  
      override fun onCreateView(
          inflater: LayoutInflater, container: ViewGroup?,
          savedInstanceState: Bundle?
      ): View? {
  
          val adFrag = inflater.inflate(R.layout.banner_filler, container, false)
          fragContext = context
  
          initializeBannerAd()
  
          viewAppender(fragContext!!, adFrag)
  
          loadBannerAd()
          return adFrag
      }
  
      private fun initializeBannerAd() {
          MobileAds.initialize(fragContext!!)
      }
  
      private fun loadBannerAd() {
          val adRequest = AdRequest.Builder().build()
          mAdView.loadAd(adRequest)
      }
  
      fun viewAppender(contxt: Context, adFrag: View) {
          mAdView = AdView(contxt)
          mAdView.setAdSize(AdSize.BANNER)        // also same issue with SMART_BANNER
          mAdView.setAdUnitId(mAppUnitId)
  
          (adFrag as FrameLayout).addView(mAdView)
      }
  
      override fun onDestroyView() {
          mAdView.destroy()
          super.onDestroyView()
      }
  
      override fun onDestroy() {
          mAdView.destroy()
          super.onDestroy()
      }
  
      override fun onResume() {
          super.onResume()
          mAdView.resume()
      }
  
  
      override fun onPause() {
          super.onPause()
          mAdView.pause()
      }
  
  }
  
  </code></pre>
  <p>Layout (banner_filler) is as follows:</p>
  <pre><code>&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;
  &lt;FrameLayout
      xmlns:tools=&quot;http://schemas.android.com/tools&quot;
      xmlns:android=&quot;http://schemas.android.com/apk/res/android&quot;
      xmlns:app=&quot;http://schemas.android.com/apk/res-auto&quot;
      tools:context=&quot;.activities.AdBFiller&quot;
      android:layout_width=&quot;match_parent&quot;
      android:layout_height=&quot;match_parent&quot;&gt;
  
  &lt;/FrameLayout&gt;
  </code></pre>
  <p>Call in place of usage is</p>
  <pre><code> private fun inflateAds() {
          supportFragmentManager
              .beginTransaction()
              .setTransition(FragmentTransaction.TRANSIT_FRAGMENT_OPEN)
              .add(R.id.adStub, AdBFiller())
              .commit()
      }
  </code></pre>
  <p>adStub is a FrameLayout</p>
  <p>I guess this is automatically happening because of AdMob code, as it was working good for many days.
  How to insulate app, from the impact of these?</p>
  <p>Although effect is minor in the video, <strong>my other pages are greatly affected</strong></p>
  <p><a href="https://youtu.be/YrTY3a3MmSM" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/wiwXL.png" alt="Video thumbnail" /><br />
  Flickering video</a></p>
  <hr />
  <h2><strong>EDIT:</strong></h2>
  <p>Turns out this is an issue specific to my mobile/manufacturer and because of WebView loading on the page.
  Since Ads use webview, it appeared as the cause of issue lied within the Ad injected code</p>
  <p>Model: Honor Huawei - 9N,<br />
  LLD-AL20,<br />
  EMUI 9.1.0,<br />
  Android Verion 9</p>
  <p><em>Specifics:</em></p>
  <p>The content of webview has to finish loading for this problem to start. Some views are relatively unaffected. For every load of page, those same elements of the page are affected i.e. fixed reproduction means out of 50 elements on page, everytime those fixed 20 are affected.</p>
  <p>I guess I have to position &amp; inflate WebView is a manner which doesn't interfere with rest of elements.</p>
  <p>Webview or ads are last element just before closing of the Root ConstrainLayout for the Fragment.</p>
  <p>Has anyone found fix for issue like this?</p>