title: Updating a textView after certain time elapsed
body: <p>I am using System.NanoTime to track elapsed time, however it does not update on the UI. Following is my code: </p>
  
  <p>I am however doing everything in the <code>onCreate()</code> method, the approach I've taken might not be robust, but that's where I want more ideas. </p>
  
  <pre><code>protected void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.activity_main);
  
  
      long startTime = System.nanoTime();
      // ... the code being measured ...
      long estimatedTime = (System.nanoTime() - startTime) / 1000000000;
      System.out.println(""+estimatedTime);
      while (estimatedTime &lt;= 100){
          System.out.println(""+estimatedTime);
  
          if(estimatedTime == 1){
              TextView tx = (TextView)findViewById(R.id.textView);
              tx.setText("Preparing"); 
  
          }
          if(estimatedTime == 2){
              TextView tx = (TextView)findViewById(R.id.textView);
              tx.setText("Inatializing"); 
  
          }
          if(estimatedTime == 3){
              TextView tx = (TextView)findViewById(R.id.textView);
              tx.setText("Preparing to install"); 
  
          }
          if(estimatedTime == 4){
              TextView tx = (TextView)findViewById(R.id.textView);
              tx.setText("Installing"); 
  
          }
          if(estimatedTime == 5){
              TextView tx = (TextView)findViewById(R.id.textView);
              tx.setText("Installed"); 
  
          }
          if(estimatedTime == 6){
              TextView tx = (TextView)findViewById(R.id.textView);
              tx.setText("Unzipping packages..."); 
  
          }
  
  
          estimatedTime = (System.nanoTime() - startTime) / 1000000000;
      }
  
  }
  </code></pre>