What is difference between ` DialogInterface.dismiss()` and `DialogInterface.cancel()`? [duplicate]
问题 This question already has answers here : What is the difference between a dialog being dismissed or canceled in Android? (3 answers) Closed 2 years ago . While working with dialogs in android one can cancel it or dismiss it, But when to use dismiss and when to use cancel? what is the difference between them? Thanks in advance. 回答1: public void cancel () Since: API Level 1 Cancel the dialog. This is essentially the same as calling dismiss(), but it will also call your DialogInterface