Chinaunix首页 | 论坛 | 博客
  • 博客访问: 15089
  • 博文数量: 7
  • 博客积分: 204
  • 博客等级: 入伍新兵
  • 技术积分: 80
  • 用 户 组: 普通用户
  • 注册时间: 2010-12-22 13:26
文章分类

全部博文(7)

文章存档

2011年(7)

我的朋友
最近访客

分类: 嵌入式

2011-03-17 19:50:01

protected onCreateDialog (int id, args)
Since:

If you use , 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,你就得自己重写这个方法。当然你也可以不选择此方法,随时用,随时创建。

若你想让系统调用此方法之前做点什么,你可以重写方法。

Parameters
id The id of the dialog.
args The dialog arguments provided to .
Returns
  • The dialog. If you return null, the dialog will not be created.
See Also
  • 系统会抛异常
阅读(1489) | 评论(0) | 转发(0) |
0

上一篇:个性化Dialog

下一篇:AlertDialog

给主人留下些什么吧!~~