title: Networking on Android NetworkOnMainThreadException
body: <p>I have a class called ServerHelper which extends Thread
  In</p>
  
  <pre><code>@Override
  public void run
  InetAddress svrAddr = InetAddress.getByName(SERVERIP);
  socket = new Socket(svrAddr, SERVERPORT);
  </code></pre>
  
  <p>ServerHelper is singleton because I want to use the same socket connection between the different activities. On the first Activity I call</p>
  
  <pre><code>ServerActivity.getInstance().run();
  </code></pre>
  
  <p>Then I get the exception. I checked the Debug pane and the run() is running on the Main thread. Why is that?</p>
  
  <p>Surely if it extends Thread it should automatically kick of on a new thread right?</p>
  
  <p>Thanks</p>