title: Confused with threading - Handler blocks UI thread
body: <p>I have a time consuming task (iterating through files and sending it's content to server)  that I want to execute in background thread, in specific interwal (that's why I want to use Handler).</p>
  
  <p>From UI thread I have a call like this:</p>
  
  <pre><code>LogsManager lm;
  lm = new LogsManager(this);
  lm.processLogFiles();
  </code></pre>
  
  <p>And in <code>LogsManager</code> class I have following piece of code:</p>
  
  <pre><code>public void processLogFiles(){
      Handler mHandler = new Handler();
      mHandler.postDelayed(logsRunable, 1000);    
  }
  
  private Runnable logsRunable = new Runnable() {
          @Override
          public void run() {
              File f = new File(Environment.getExternalStorageDirectory()+Constants.LOG_DIR);             
              File[] logFiles = f.listFiles();
              for (int i = 0; i &lt; logFiles.length; i++) {
                  readLogs(logFiles[i]); // executes some other methods inside
              }
          }
      };
  </code></pre>
  
  <p>As you can see it's just method with <code>Handler</code> that calls <code>Runnable</code>. And, unfortunately it also blocks my UI thread. Isn't <code>Handler</code> supposed to start a new thread for <code>Runnable</code>? I use handlers in other parts of my app also, and they works just fine. Am I'm doing something wrong? </p>