title: Android: Heavy DB operations with progress dialog
body: <p>I have used to <a href="http://developer.android.com/reference/android/database/sqlite/SQLiteDatabase.html#beginTransaction%28%29" rel="nofollow">following</a> idiom on the <code>doInBackground</code> method of an AsyncTask for quick inserts into the DB:</p>
  
  <pre><code>    mDatabase.beginTransaction();
      try {
              //... do DB stuff
  
              mDatabase.setTransactionSuccessful();
      } finally {
              mDatabase.endTransaction();
      }
  </code></pre>
  
  <p>However, if I use this idiom, my progress dialog (placed in the <code>onPreExecute</code> method) is not displayed. On the other hand, if I replace the above code with regular mDatabase.execSQL() statements, the progress dialog does get displayed but inserts become very slow. Is there any way I can have the best of both worlds (i.e., progress dialog and fast insertions). Thanks!</p>
  
  <p>Note: beginTransaction run in EXCLUSIVE mode (I don't get what that means tbh). Is this the cause?</p>