title: How do I implement multi thread on an Android Activity?
body: <p>I've created a nested class within my Activity</p>
  
  <pre><code>public class MissionsActivity extends Activity {
  
  class UpdateMissions implements Runnable {
  
      @Override
      public void run() {
        android.os.Process.setThreadPriority(android.os.Process.THREAD_PRIORITY_BACKGROUND);
          [...]
  }
  
     [...]
  }
  </code></pre>
  
  <p>In the thread I have to read a file and update some <code>TextFields</code> in the layout. I've tried implementing the <code>run()</code> method with a <code>while(true)</code> that reads and updates the fields, but the app just crashes when I start that <code>Activity</code>.</p>
  
  <p>UPDATE: I've called the <code>execute()</code> method inside the <code>onCreate()</code> method of the UI Activity. The Task is only working the first time I enter the Activity, if i change and go back it won't do anything.</p>