3

I'm really interested if I can create two dialogs in Android in same time in one activity. Here is what I want to achieve : I want to have a circle progress bar with a cancel button and at the bottom of my activity to have a horizontal progress dialog which indicates some calculations. Is there any option to create something like this or similar to this?

Thanks in Advance!

enter image description here

Android-Droid
  • 14,365
  • 41
  • 114
  • 185

3 Answers3

2

There is no reason why the synchronizing bar, progress bar, and cancel button could not be part of the same dialog that has a transparent background.

Jonathan Schneider
  • 26,852
  • 13
  • 75
  • 99
2

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);
Newts
  • 1,354
  • 14
  • 23
2

You cannot show multiple dialogs at the same time, however you can create an activity with a transparent background which looks like two different dialogs.

Community
  • 1
  • 1
Dalmas
  • 26,409
  • 9
  • 67
  • 80