ProgressDialog的dismiss方法与cancel方法的区别
2016-03-20 09:48
435 查看
(转载)/article/2884965.html
上一篇博客AsyncTask的用法有一个ProgressDialog,它有两个方法dialog.cancel() 和pdialog.dismiss();
都是取消关闭ProgressDialog,有什么区别吗?
查询API文档,ProgressDialog继承于Dialog,而cancel和dismiss就是在Dialog类中。
Cancel the dialog. This is essentially the same as calling
call your
取消对话框,基本上和调用dismiss效果一样。但是cancel同事也会调用
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
参见Dialog类源码:http://www.oschina.net/code/explore/android-2.2-froyo/android/app/Dialog.java
上一篇博客AsyncTask的用法有一个ProgressDialog,它有两个方法dialog.cancel() 和pdialog.dismiss();
都是取消关闭ProgressDialog,有什么区别吗?
查询API文档,ProgressDialog继承于Dialog,而cancel和dismiss就是在Dialog类中。
public void cancel ()
Since: API Level 1Cancel the dialog. This is essentially the same as calling
dismiss(), but it will also
call your
DialogInterface.OnCancelListener(if registered).
取消对话框,基本上和调用dismiss效果一样。但是cancel同事也会调用
DialogInterface.OnCancelListener注册的事件,如果注册了。
public void dismiss ()
Since: API Level 1Dismiss 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().
参见Dialog类源码:http://www.oschina.net/code/explore/android-2.2-froyo/android/app/Dialog.java
相关文章推荐
- BC#76.2DZY Loves Balls
- 第四周项目5:用递归方法求解(1)求n的阶乘
- 查看网站后台
- CodeForces 630 G. Challenge Pennants(组合数学)
- Oracle 11g 新特性 -- Database Replay (重演)
- 日经春秋 20160320
- [20160320] 刚刚会用的GitHub / WarTime-Project On GitHub / BestCoder Round #76
- 【原】Spark Rpc通信源码分析
- 一道笔试题 - 数字转大写金额
- 【HDU5647 BestCoder Round 76 (div1)B】【树形DP】DZY Loves Connecting 一棵树的所有生成子树的大小乘积
- POJ1833 排列
- 连续发送多份小数据时40ms延迟问题
- mybatis高级映射一对多查询(一)
- 谷歌浏览器 标签
- 第39讲项目2 ——n=a!+b!+c!
- 天声人語 20160320 シジュウカラがつづる「文」
- Dialog背景的设置
- 【HDU5646 BestCoder Round 76 (div1)A】【贪心】DZY Loves Partition n个数拆分k个最大乘积
- Display Port 和 eDisplay Port
- docker registry v2使用配置