title: Progress Dialog is paused
body: <p>Here it is. </p>
  
  <p>Before fetching the data, creating the progress dialog and showing it now fetching data from server using volley library. It working fine. After that I need to send the data to local database as follow:</p>
  
  <pre><code>if (responseStatusCondition) {
     JSONArray jsonArray=response.getJSONArray("response");
  
     for (int i=0;i&lt;jsonArray.length();i++) {
        JSONObject childJSONObject = jsonArray.getJSONObject(i);
  
        // Set the flag bit to 1 since data is already at server
        long result = bloodPressureDatabaseFragment.insertIntoBloodPressureDetails(
                            childJSONObject.getInt("systolic"),
                            childJSONObject.getInt("diastolic"),
                            childJSONObject.getLong("timestamp"),1 );
     }
  }
  </code></pre>
  
  <p>Now problem is this, since the fetching part is happening in background is ok. <strong>But the insertion data into db part is happening on the Main UI which leads to pause the progress dialog.</strong> Is there any way to solve this problem.  </p>
  
  <p>I have done insertions part through the <strong>AsynckTask</strong>. Is there any alternative to do this task. I also read we can this through the use of Async-Await. </p>
  
  <p>It is good if you please comment the reason of downvoting the question.</p>