Android: Can i show multiple Dialogs one over another? Is there something like Dialog Z-Level?

后端 未结 3 965
情话喂你
情话喂你 2021-01-12 09:50

Is it possible to show multiple Dialogs one over another? Is there something like Dialog Z-Level? I am using DialogFragment where user chooses elements, when he comfirms his

3条回答
  •  执笔经年
    2021-01-12 10:10

    You usually can, however, just be a little careful. Use the dialog's lifecycle to your advantage to avoid side-effects. For example: you can do a check on a function like onStop() to see if the child dialog is open, and if so, close it.

    Ideally, cutting down on the amount of layers of dialogs you have is ideal, as long as it's sane (for example: doing it ends up being hundreds of lines of code more)

提交回复
热议问题