免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 853 | 回复: 0
打印 上一主题 下一主题

跟Dialog干上了 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2011-12-20 09:44 |只看该作者 |倒序浏览
protected Dialog onCreateDialog (int id, Bundle args)
Since: API Level 8

If you use showDialog(int), the activity will call through to this method the first time, and hang onto it thereafter. Any dialog that is created by this method will automatically be saved and restored for you, including whether it is showing.

当你调用showDialog(int )方法时,系统会自动调用此方法,如果是第一次调用,会根据你对onCreateDialog(int ,Bundle)的实现创建此Dialog,然后系统为你保存下此dialog,以备下次再调用showDialog(int)方法时直接展现系统为你保存的此Dialog,而不会再调用onCreateDialog(int ,Bundle ) 方法去创建Dialog。

如果你想要系统为你管理保存dialogs,你就得自己重写这个方法。当然你也可以不选择此方法,随时用,随时创建。

若你想让系统调用此方法之前做点什么,你可以重写onPrepareDialog(int, Dialog, Bundle)方法。

Parameters
id The id of the dialog.
args The dialog arguments provided to showDialog(int, Bundle).
Returns
  • The dialog. If you return null, the dialog will not be created.
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP