Android开发

Android中ProgressDialog的dismiss()与cancel()方法的区别

本文主要是介绍Android中ProgressDialog的dismiss()与cancel()方法的区别,对大家解决编程问题具有一定的参考价值,需要的程序猿们随着小编来一起学习吧!

progressDialog, 它有两个方法dialog.cancel() 和 dialog.dimiss()

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.OnCancelListener (if registered).

2.public void dismiss ()

Since: API Level 1
Dismiss this dialog, removing it from the screen. This method can be invoked safely from any thread. Note that you should not override this method to do cleanup when the dialog is dismissed, instead implement that in onStop().

其中,采用cancel()方法会调用DialogInterface.OnCancelListener ()。

以上就是本文的全部内容,希望本文的内容对大家的学习或者工作能带来一定的帮助,同时也希望多多支持找一找教程网!

这篇关于Android中ProgressDialog的dismiss()与cancel()方法的区别的文章就介绍到这儿,希望我们推荐的文章对大家有所帮助,也希望大家多多支持为之网!