title: WebView fails to load data
body: <p>I have a <code>WebView</code> element into which I am trying to load simple HTML data:</p>
  
  <pre><code>var data = @"
      &lt;html&gt;
      &lt;head&gt;
      &lt;/head&gt;
      &lt;body&gt;
          &lt;div id='graph' class='panel'&gt;test&lt;/div&gt;
      &lt;/body&gt;
      &lt;/html&gt;";
  var encodedData = Base64.EncodeToString(Encoding.UTF8.GetBytes(data), Base64Flags.Default);
  
  webView.LoadData(encodedData, "text/html", "base64");
  </code></pre>
  
  <p>When the app reaches this part, however, the WebView disappears entirely without any trace in logcat.  I am using Xamarin C# with Android 8 (Oreo).  Is my setup correct, e.g. encoding?  Why might this be happening?</p>
  
  <h2>Edit</h2>
  
  <p>Due to a misunderstanding I had with my previous self, I was of the mistaken opinion that the <code>WebView</code> disappeared when it should have been loading data.  I have recently determined this is not in fact the case, and have updated the question title accordingly.</p>
  
  <p>The <code>WebView</code> is, however, still at least appearing to fail in loading data as above.  Per requests in the comment I am including a pared down MVP of the layout and activity code.</p>
  
  <h3>Layout:</h3>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
      android:orientation="vertical"
      android:layout_width="match_parent"
      android:layout_height="match_parent"&gt;
      &lt;Button
          android:text="@string/submit"
          android:id="@+id/btnSubmit"
          android:layout_width="match_parent"
          android:layout_height="wrap_content" /&gt;
      &lt;WebView
          android:layout_width="match_parent"
          android:layout_height="0dp"
          android:id="@+id/grpWebView"
          android:foreground="#7D756B"
          android:layout_weight="1" /&gt;
  &lt;/LinearLayout&gt;
  </code></pre>
  
  <h3>Activity:</h3>
  
  <pre><code>namespace AndroidCrmApp
  {
      using System;
      using System.Text;
      using Android.App;
      using Android.OS;
      using Android.Util;
      using Android.Webkit;
      using Android.Widget;
  
      /// &lt;summary&gt;
      /// Application launcher
      /// &lt;/summary&gt;
      [Activity(Label = "Cross Reference Mapper", MainLauncher = true, Icon = "@drawable/Icon", ScreenOrientation = Android.Content.PM.ScreenOrientation.Portrait)]
      public class MainActivity : Activity
      {
          private Button btnSubmit;
          private WebView grpWebView;
  
          /// &lt;inheritdoc/&gt;
          protected override void OnCreate(Bundle bundle)
          {
              base.OnCreate(bundle);
  
              // Set our view from the "main" layout resource
              this.SetContentView(Resource.Layout.Main);
  
              this.btnSubmit = this.FindViewById&lt;Button&gt;(Resource.Id.btnSubmit);
              this.btnSubmit.Click += this.BtnSubmit_Click;
  
              this.grpWebView = this.FindViewById&lt;WebView&gt;(Resource.Id.grpWebView);
          }
  
          private void BtnSubmit_Click(object sender, EventArgs e)
          {
              var data = @"
                  &lt;html&gt;
                  &lt;head&gt;
                  &lt;/head&gt;
                  &lt;body&gt;
                      &lt;div id='graph' class='panel'&gt;test&lt;/div&gt;
                  &lt;/body&gt;
                  &lt;/html&gt;";
              var encodedData = Base64.EncodeToString(Encoding.UTF8.GetBytes(data), Base64Flags.Default);
  
              this.grpWebView.LoadData(encodedData, "text/html", "UTF-8");
          }
      }
  }
  </code></pre>
  
  <p>Again, the main concern is it seems the <code>WebView</code> functionality has changed in a way that I am not aware of, despite looking into the Android documentation.  I will check other aspects of my build environment, but would be interested to see if anything is suspect with the provided code.</p>
  
  <h2>Edit 2</h2>
  
  <p>Upon further investigation I have confirmed the only change that is necessary to bring about this unexpected behavior is targeting Android 8.  (Previously I had been targeting 7.1.)</p>
  
  <p>Before I press the button I clear the console; after pressing the button the following warnings are logged:</p>
  
  <pre><code>07-26 12:56:41.737 W/VideoCapabilities(26287): Unrecognized profile 2130706433 for video/avc
  07-26 12:56:41.737 W/VideoCapabilities(26287): Unrecognized profile 2130706434 for video/avc
  07-26 12:56:41.743 W/VideoCapabilities(26287): Unrecognized profile 2130706433 for video/avc
  07-26 12:56:41.743 W/VideoCapabilities(26287): Unrecognized profile 2130706434 for video/avc
  07-26 12:56:41.774 W/VideoCapabilities(26287): Unrecognized profile/level 0/3 for video/mpeg2
  07-26 12:56:41.807 W/VideoCapabilities(26287): Unrecognized profile 2130706433 for video/avc
  07-26 12:56:41.807 W/VideoCapabilities(26287): Unrecognized profile 2130706434 for video/avc
  </code></pre>
  
  <p>I have also tried setting a view client with no apparent change in logs or behavior:</p>
  
  <pre><code>webView.SetWebViewClient(new WebViewClient());
  </code></pre>
  
  <p>I have been doing more reading and it seems the <code>WebView</code> is generally falling away in favor to Chrome as the main means of loading HTML content in an app.  I am considering migrating away from <code>WebView</code> as a result.</p>