AlertDialog

来源:互联网 发布:淘宝怎么认证实名认证 编辑:程序博客网 时间:2024/06/11 23:49

AlertDialog的构造方法:

Protected constructors

AlertDialog(Context context)

Creates an alert dialog that uses the default alert dialog theme.

AlertDialog(Context context, boolean cancelable, DialogInterface.OnCancelListener cancelListener)

Creates an alert dialog that uses the default alert dialog theme and a custom cancel listener.

AlertDialog(Context context, int themeResId)

Creates an alert dialog that uses an explicit theme resource.

保护属性,不能通过new AlertDialog()直接实例化AlertDialog.

通过AlertDialog.Builder dialog=new AlertDialog.Builder(this);来构造AlertDialog实例.

其中setCancelable()是设置提示对话框(AlertDialog)能否被Back键取消   默认值为true.

0 0
原创粉丝点击