mWaitPromptDialog.setOnKeyListener(new OnKeyListener(){ //mWaitPromptDialog为dialog
public boolean onKey(DialogInterface dialog, int keyCode,
KeyEvent event) {
// TODO Auto-generated method stub
if(keyCode==KeyEvent.KEYCODE_BACK) {
finish(); //结束这个activity
}
return false;
}
});
在有Dialog的activity上,如何点击back直接结束此activity
最新推荐文章于 2020-02-12 19:41:53 发布