如何屏蔽back键,当点击back键时Dialog对话框不消失

mSaveingProgressDialog.setOnKeyListener(mDialogOnKeylistener);    

DialogInterface.OnKeyListener mDialogOnKeylistener = new DialogInterface.OnKeyListener(){
        public boolean onKey(DialogInterface dialog, int keyCode, KeyEvent event) {
            if (mSaveing) {
                if (KeyEvent.KEYCODE_BACK == keyCode) {
                    return true;
                }
            }
            return false;
        }
    } ;

 

你可能感兴趣的:(Android经验分享)