title: How Display SetText Value on UI after reading a file line by line in android?
body: <p>I am using BufferedReader to read from a text file line by line and want to display the line simultaneously on the Android UI.   </p>
  
  <p>I have tried to solve the problem using various delays, but it did not solve my problem.   </p>
  
  <pre><code> BufferedReader reader;
              try {
                  reader = new BufferedReader(new FileReader(filePath));
                  Log.e("File path",filePath);
                  parsedByteStream = reader.readLine();
                  while (parsedByteStream != null) {
                      Log.i("Line",parsedByteStream);
                      fileDataStream[lineNo] = parsedByteStream;
                      lineNo++;
                      parsedByteStream = reader.readLine();
                  }
                  reader.close();
              } catch (IOException e) {
                  e.printStackTrace();
              }
              for (int i=0;i&lt;lineNo;i++) {
                  myTextView.setText(fileDataStream[i]);
                  try {
                      TimeUnit.MILLISECONDS.sleep(50);
                  } catch (InterruptedException e) {
                      e.printStackTrace();
                  }
              }
  </code></pre>
  
  <p>On the Android UI I am only getting the last line on the UI as the set text value.</p>