title: HttpURLConnection is throwing exception
body: <p>Here is my code to connect <code>HTTP</code>.</p>
  
  <pre><code>URL url = new URL("http://www.google.com");
                HttpURLConnection con = (HttpURLConnection) url.openConnection();
                con.setDoOutput(true);
                String responseMsg = con.getResponseMessage();
                int response = con.getResponseCode();
  </code></pre>
  
  <p>this is throwing <code>android.os.NetworkOnMainThreadException</code></p>
  
  <p>Please help.</p>