title: Android NetworkOnMainThreadException when calling Url.OpenStream
body: <p>I get this exception  when running my code on emulator (Android 4.0.3 / API 15). While opening a stream it will throw an exception. Error-message is <code>null</code>.</p>
  
  <pre><code>try {
      String adress        = "xxx";
      URL url              = new URL(adress);
      InputSource source   = new InputSource(url.openStream());
  
  } catch (Exception e) {
      (new TextView).setText("Error: "+e.getMessage());
  }
  </code></pre>
  
  <p>URL is still working with the emulator (in browser).</p>
  
  <p>I have cleaned the project.</p>
  
  <p>Also Internet connection is allowed:</p>
  
  <pre><code>&lt;uses-permission android:name="android.permission.INTERNET" /&gt;
  </code></pre>
  
  <p>Exception : <code>android.os.NetworkOnMainThreadException</code></p>