How to keep the dialog in the middle after the activity went into onPause in Android?

I have a button which will show a progressDialog in the middle of the screen and call a sdk to open a camera screen in that sdk at the same time.
The problem is that the progreeDialog will show in the right position about 1 second and change its position to show itself to the right-top of the screen while calling the sdk. I realized maybe it is because that when the app called the sdk successfully the activity will go to onPause and the dialog will lose its correct position.
If I am thinking it right, is there any solution to keep the dialog showing in the center of the screen even if the activity has entered into the pause status?
By the way, this only happens on the device with a Android S system.
Please tell me any idea which may help to solve this problem, thanks.