Android 点击回退按钮时弹出提示框
来源:互联网 发布:南京好玩的地方知乎 编辑:程序博客网 时间:2024/06/03 18:31
public boolean onKeyDown(int keyCode, KeyEvent event) {
if(keyCode==KeyEvent.KEYCODE_BACK&&event.getRepeatCount()==0){
AlertDialog.Builder alertbBuilder=new AlertDialog.Builder(YDZF_DemoActivity.this);
alertbBuilder.setTitle("提示").setMessage("确认退出?").setPositiveButton("确定", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
//结束这个Activity
YDZF_DemoActivity.this.finish();
}
}).setNegativeButton("取消", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
dialog.cancel();
}
}).create();
alertbBuilder.show();
}
return true;
};s
if(keyCode==KeyEvent.KEYCODE_BACK&&event.getRepeatCount()==0){
AlertDialog.Builder alertbBuilder=new AlertDialog.Builder(YDZF_DemoActivity.this);
alertbBuilder.setTitle("提示").setMessage("确认退出?").setPositiveButton("确定", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
//结束这个Activity
YDZF_DemoActivity.this.finish();
}
}).setNegativeButton("取消", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
dialog.cancel();
}
}).create();
alertbBuilder.show();
}
return true;
};s
- Android 点击回退按钮时弹出提示框
- Android 点击按钮弹出提示框实例
- Android点击返回按钮弹出提示“点击两次退出程序”
- 点击按钮弹出对话框提示
- 点击按钮Alert弹出遮罩层效果的提示框代码
- 点击按钮弹出框
- jQuerymobile popup弹出层 '关闭'按钮点击页面回退 bug解决
- offset+position点击按钮弹出提示框,且提示框紧贴按钮
- 点击IE关闭按钮弹出提示
- javascript:IE点击关闭按钮,弹出提示
- Android点击按钮弹出对话框
- 点击弹出提示框
- onpopstate浏览器点击回退按钮时触发的事件
- onpopstate浏览器点击回退按钮时触发的事件
- onpopstate浏览器点击回退按钮时触发的事件
- 点击回退按钮刷新页面
- 点击按钮,在电脑右下端弹出提示框,鼠标不离开,提示框不消失。
- 点击按钮弹出下载框
- springMVC pom.xm配置
- 理解 Linux 配置文件
- CPU对内存的读写
- 分析RF电路设计中的常见问题
- 截取URL的正则表达式
- Android 点击回退按钮时弹出提示框
- 我们分手吧,因为我不是处女!
- android 当环境配置发生变化 例如语言 屏幕变化
- Android开发如何正确使用WebView
- 泛型 和IComparable、IComparer
- 设计模式11——Composite设计模式
- 天猫: 时尚杂志式的移动网购应用
- ubuntu与windows双系统安装
- size_type与size_t