title: A question about Android runnable
body: <p>I saw a piece of code online. I am wondering why we need to use runnable to set text of TextView? Thanks!</p>
  
  <pre><code>    while (true) {
      // listen for incoming clients
      Socket client = serverSocket.accept();
      handler.post(new Runnable() {
          @Override
          public void run() {
              serverStatus.setText("Connected.");
          }
      });
  </code></pre>
  
  <p><a href="http://thinkandroid.wordpress.com/2010/03/27/incorporating-socket-programming-into-your-applications/" rel="nofollow">http://thinkandroid.wordpress.com/2010/03/27/incorporating-socket-programming-into-your-applications/</a></p>