title: Android Refresh TextView from Thread
body: <p>I know there are already quite a number of discussions about this, but none of what I found could clear my confusion.<br>
  I'm using the Android SDK for the first time and my Java Skills are rather average.</p>
  
  <p>I have the following Problem:<br>
  From my MainActivity - OnCreate() fct. I start a thread (Receiver), receiving data from a SocketStream. This thread shall refresh a TextView-Element on the GUI when new data was read from the stream.<br>
  What is a simple but proper way to do so? I read something about ASyncTask, but did not understand how to implement it.  </p>
  
  <pre><code>public class MainActivity extends Activity 
  {
      ExecutorService myExecutor;
  
      protected void onCreate(Bundle savedInstanceState) 
      {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.activity_main);
          System.out.println("this is a test"); System.out.flush();
  
          try 
          {
              myExecutor = Executors.newCachedThreadPool();
              myExecutor.execute(Receiver.getInstance());
          } 
          catch (IOException e) 
          {
              e.printStackTrace();
          }
      }
  </code></pre>
  
  <p>...</p>
  
  <pre><code>public class Receiver implements Runnable  
  {  
  [...]  
      public void run()  
      {  
          while (true)  
          {  
              //blocking system-io-call to read data from socket..  
              //extract information  
              // *** update textView *** ??  
          }  
      }  
  }  
  </code></pre>