user2707175
user2707175

Reputation: 1137

android two dialogs - how to return to the previous one when pressing back button

I have two dialogs, both DialogFragments, I want to display first one, and next when user select some options, the second one (some kind of wizard similar behaviour). Is there any way to return from the second dialog to the first dialog when pressing back button. How to do that in the easiest way?

Thanks in advance for help.

Upvotes: 1

Views: 77

Answers (1)

zegnus
zegnus

Reputation: 1457

You can add a setOnDismissListener to you dialog and start a new dialog if you want.

I would suggest that instead of creating dialogs, you create activities.

By the way, do you know that you can create activities and show them as dialogs? Apply the style parent="android:Theme.Dialog" to your activity and you will be able to do what you want nicely without tricks

Upvotes: 1

Related Questions