安卓弹出对话框,禁用返回键使其消失

 

AlertDialog.Builder setCancelable用法

分类: android

AlertDialog.Builder的setCancelable

 

public AlertDialog.Builder setCancelable (boolean cancelable)

Since: API Level 1

Sets whether the dialog is cancelable or not default is true.

设置为false,按返回键不能退出。默认为true。

妈蛋,一直以为是返回键重写应该是return  TRUE还是FALSE的问题,原来竟然是builder自身的属性,自己不去设置这个属性,默认是可以按返回键使其消失的!!!!!

posted @ 2014-10-23 20:29  伟大的臭猪猪  阅读(862)  评论(0)    收藏  举报