What is the difference between a dialog being dismissed or canceled in Android?

前端 未结 4 889
醉酒成梦
醉酒成梦 2020-12-02 05:27

Like the title says, what is the difference between a dialog being dismissed or canceled in Android?

4条回答
  •  攒了一身酷
    2020-12-02 06:04

    Typically, a dialog is dismissed when its job is finished and it is being removed from the screen. A dialog is canceled when the user wants to escape the dialog and presses the Back button.

    For example, you have a standard Yes/No dialog on the screen. If the user clicks No, then the dialog is dismissed and the value for No is returned to the caller. If instead of choosing Yes or No, the user clicks Back to escape the dialog rather than make a choice then the dialog is canceled and no value is returned to the caller.

提交回复
热议问题