Progress dialog not showing in AsyncTask
<p>I have a huge array of Strings which I'm trying to insert into the sqlite DB. Due to this, I am using the <a href="http://developer.android.com/reference/android/database/sqlite/SQLiteDatabase.html#beginTransaction%28%29" rel="nofollow">begintransaction idiom</a> in my <code>doInBackground</code>, which works perfectly. The problem is that the ProgressDialog is <strong>not</strong> being shown. What could be the problem? Is it  because beginTransaction works only in EXCLUSIVE mode? Any help is appreciated. Thanks!</p>

<pre><code>    @Override
    public void onCreate(SQLiteDatabase database) {
        database.execSQL(Constants.CREATE_TABLE_DICT);
        mDatabase = database;
        readFile(R.raw.dict);
        new InitDB().execute();
    }



    public class InitDB extends AsyncTask&lt;Void, Void, Void&gt; {
        InsertHelper ih;
        int wordColumn;
        private ProgressDialog mProgD;

        @Override
        protected void onPreExecute() {
            super.onPreExecute();
            mProgD = ProgressDialog.show(mContext, "", "Wait", true);//NOT BEING SHOWN!
            ih = new InsertHelper(mDatabase, "dictionary");
            wordColumn = ih.getColumnIndex("word");
        }

        @Override
        protected Void doInBackground(Void... params) {
            mDatabase.beginTransaction();
            try {
                String [] ss = mWords.toString().split("\\|");
                for(int i=0; i&lt;ss.length; i++) {
                    ih.prepareForInsert();
                    String word = ss[i];
                    ih.bind(wordColumn, word);
                    ih.execute();
                }

                mDatabase.setTransactionSuccessful();
            } finally {
                mDatabase.endTransaction();
            }

            return null;
        }

        @Override
        protected void onPostExecute(Void result) {
            super.onPostExecute(result);
            mProgD.dismiss();
        }
    }
</code></pre>

<p><strong>EDIT:</strong>
Here's where the context comes from:</p>

<pre><code>    //Constructor
    public AppDatabase(Context context) {
        super(context, Constants.DATABASE_NAME, null, Constants.DATABASE_VERSION);
        mContext = context;
    }
</code></pre>
