I am having some of the following exceptions:
java.lang.IllegalArgumentException: View not attached to window manager at android.view.WindowManagerImpl.findV
Why not try catch, like this:
protected void onPostExecute(Object result) { try { if ((mDialog != null) && mDialog.isShowing()) { mDialog.dismiss(); } } catch (Exception ex) { Log.e(TAG, ex.getMessage(), ex); } }