Porém quando você rotaciona o aparelho, rotacionando a tela também em quanto a progressDialog esteja em execução é fechado a aplicação e exibido o erro de Unfortunately APP has stopped com o log do console:
E/AndroidRuntime: FATAL EXCEPTION: main Process: br.com.company.appname, PID: 2925 java.lang.IllegalArgumentException:
View=com.android.internal.policy.impl.PhoneWindow$DecorView{9d3787a0 V.E..... R......D 0,0-1166,288} not attached to window manager at android.view.WindowManagerGlobal.findViewLocked(WindowManagerGlobal.java:370) at android.view.WindowManagerGlobal.removeView(WindowManagerGlobal.java:299) at android.view.WindowManagerImpl.removeViewImmediate(WindowManagerImpl.java:84) at android.app.Dialog.dismissDialog(Dialog.java:329) at android.app.Dialog.dismiss(Dialog.java:312) at br.com.company.appname.MainActivity$1.onPageFinished(MainActivity.java:48) at com.android.webview.chromium.WebViewContentsClientAdapter.onPageFinished(WebViewContentsClientAdapter.java:449) at com.android.org.chromium.android_webview.AwContentsClient$AwWebContentsObserver$1.run(AwContentsClient.java:73) at android.os.Handler.handleCallback(Handler.java:733) at android.os.Handler.dispatchMessage(Handler.java:95) at android.os.Looper.loop(Looper.java:136) at android.app.ActivityThread.main(ActivityThread.java:5017) at java.lang.reflect.Method.invokeNative(Native Method) at java.lang.reflect.Method.invoke(Method.java:515) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:779) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:595) at dalvik.system.NativeStart.main(Native Method)
Para que o problema seja resolvido basta adicionar no arquivo "AndroidManifest.xml" o trecho android:configChanges="orientation|screenSize" conforme exemplo a baixo:
<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:supportsRtl="true"
android:theme="@style/AppTheme">
<activity android:name=".MainActivity"
android:configChanges="orientation|screenSize">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
Dessa forma você pode rotacionar sua tela ao mesmo tempo de execução do progressDialog sem que a aplicação trave e apresente o erro.
Outros links:
https://developer.android.com/guide/topics/resources/runtime-changes.html?hl=pt-br
http://stackoverflow.com/questions/1111980/how-to-handle-screen-orientation-change-when-progress-dialog-and-background-thre