title: Why can I see my website in one app but not in another?
body: <p>I wanted to build a simple Android app which just includes a WebView to display my website. I used the <a href="https://developer.android.com/guide/webapps/webview.html" rel="nofollow noreferrer">offical android tutoiral</a> to do so. </p>
  
  <p>For my first app I used the fullscreen-template. After adding the WebView my <code>xml</code>-file looks like this:</p>
  
  <pre><code>&lt;FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
      xmlns:tools="http://schemas.android.com/tools"
      android:layout_width="match_parent"
      android:layout_height="match_parent"
      android:background="#0099cc"
      tools:context="com.example.janwagner.webviewdemo.FullscreenActivity"&gt;
  
      &lt;!-- The primary full-screen view. This can be replaced with whatever view
           is needed to present your content, e.g. VideoView, SurfaceView,
           TextureView, etc. --&gt;
      &lt;TextView
          android:id="@+id/fullscreen_content"
          android:layout_width="match_parent"
          android:layout_height="match_parent"
          android:gravity="center"
          android:keepScreenOn="true"
          android:text="@string/dummy_content"
          android:textColor="#33b5e5"
          android:textSize="50sp"
          android:textStyle="bold" /&gt;
  
      &lt;!-- This FrameLayout insets its children based on system windows using
           android:fitsSystemWindows. --&gt;
      &lt;FrameLayout
          android:layout_width="match_parent"
          android:layout_height="match_parent"
          android:fitsSystemWindows="true"&gt;
  
          &lt;WebView
              android:id="@+id/webView"
              android:layout_width="match_parent"
              android:layout_height="match_parent" /&gt;
  
          &lt;LinearLayout
              android:id="@+id/fullscreen_content_controls"
              style="?metaButtonBarStyle"
              android:layout_width="match_parent"
              android:layout_height="wrap_content"
              android:layout_gravity="bottom|center_horizontal"
              android:background="@color/black_overlay"
              android:orientation="horizontal"
              tools:ignore="UselessParent"&gt;
  
              &lt;Button
                  android:id="@+id/dummy_button"
                  style="?metaButtonBarButtonStyle"
                  android:layout_width="0dp"
                  android:layout_height="wrap_content"
                  android:layout_weight="1"
                  android:text="@string/dummy_button" /&gt;
  
          &lt;/LinearLayout&gt;
      &lt;/FrameLayout&gt;
  
  &lt;/FrameLayout&gt;
  </code></pre>
  
  <p>And I added this code to hte <code>java</code>-file:</p>
  
  <pre><code>WebView myWebView = (WebView) findViewById(R.id.webView);
  WebSettings webSettings = myWebView.getSettings();
  webSettings.setJavaScriptEnabled(true);
  myWebView.loadUrl("http://192.168.100.166:8080");
  </code></pre>
  
  <p>And I added the internet permission to the manifest as direct child of the <code>&lt;manifest&gt;</code>-block:</p>
  
  <pre><code>&lt;uses-permission android:name="android.permission.INTERNET" /&gt;
  </code></pre>
  
  <p>This works fine. But since I was not completely pleased with the resuling app I created a new project based on the 'empty activity'-template. This lead to this much shorter <code>xml</code>-file:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;android.support.constraint.ConstraintLayout 
      xmlns:android="http://schemas.android.com/apk/res/android"
      xmlns:app="http://schemas.android.com/apk/res-auto"
      xmlns:tools="http://schemas.android.com/tools"
      android:layout_width="match_parent"
      android:layout_height="match_parent"
      tools:context="com.example.janwagner.trainerapp.MainActivity"&gt;
  
      &lt;WebView  xmlns:android="http://schemas.android.com/apk/res/android"
      android:id="@+id/webView"
      android:layout_width="fill_parent"
      android:layout_height="fill_parent"/&gt;
  
  &lt;/android.support.constraint.ConstraintLayout&gt;
  </code></pre>
  
  <p>And I copy pasted the same code in the <code>java</code>-file:</p>
  
  <pre><code>WebView myWebView = (WebView) findViewById(R.id.webView);
  WebSettings webSettings = myWebView.getSettings();
  webSettings.setJavaScriptEnabled(true);
  myWebView.loadUrl(this._url);
  </code></pre>
  
  <p>And I again added the internet permission:</p>
  
  <pre><code>&lt;uses-permission android:name="android.permission.INTERNET" /&gt;
  </code></pre>
  
  <p>This app does not work. However loading data with </p>
  
  <pre><code>myWebView.loadData("&lt;h1&gt;Test&lt;/h1&gt;", "text/html; charset=UTF-8", null);
  </code></pre>
  
  <p>displays <em>Test</em>.</p>
  
  <p>Can someone tell me why the first version work but not the second?</p>