title: Showing a spinning wheel in the foreground while my task executes in the UI thread
body: <p>I am developing an Android app which writes into an excel sheet, when I click on a button (View), and when it finishes it shows a dialog box which informs me that the task is completed . </p>
  
  <p>Currently, when I press the button view, it shows the button in the "clicked" state until the report is generated. I would like to show a spinning wheel (indefinite progress bar case) in the foreground of the screen for the time from the moment I press the button to just before the dialog box shows up. Can someone explain with code how I should do this?</p>
  
  <p>I am meddling with the runnable class ( new thread creation) but not getting any result.</p>