How to change the position of a progress dialog?

oliverwhite picture oliverwhite · Aug 3, 2010 · Viewed 24.8k times · Source

I'm developing an android app and need to know how to change the positioning of a progress dialog. I need it to be positioned at the bottom of the screen instead of at the center like it is by default.

Answer

Rich Schuler picture Rich Schuler · Aug 3, 2010

You can call ProgressDialog#getWindow#setGravity(...) to change the gravity.

So:

ProgressDialog dialog = ProgressDialog.show(AContext, "Test", "On the bottom");
                dialog.getWindow().setGravity(Gravity.BOTTOM);