title: android update progress bar while reading records from a text file
body: <p>I am trying to find the best way to update a Progress Bar while reading in records from a text file stored on internal storage. In my activity fragment I use a button to load a progress dialog with a progress bar to be updated.</p>
  
  <p>The problem is if a the text file has over 2000+ records (1 record per line) should I count the number of lines in the text file prior to loading the records, and use this value to estimate the percentage complete for the Progress Bar? or Is there a more elegant way of doing this?</p>