弹出对话框
来源:互联网 发布:linux ftp 目录权限 编辑:程序博客网 时间:2024/05/16 05:31
先定义
private View view;private AlertDialog mProtocolDialog;
弹出对话框
private void loadProtocol() {LayoutInflater webLayout = LayoutInflater.from(this);view = webLayout.inflate(R.layout.protocol_dialog, null);view.setOnTouchListener(new OnTouchListener() {@Overridepublic boolean onTouch(View arg0, MotionEvent arg1) {StringBuilder sb = new StringBuilder();sb.append(getString(R.string.protocol));TextView protocolContent = (TextView) view.findViewById(R.id.protocol_content);protocolContent.setText(sb.toString());view.setOnTouchListener(null);return false;}});mProtocolDialog = new AlertDialog.Builder(this).setTitle(getString(R.string.protocol_title)).setView(view).setPositiveButton(getString(R.string.agree), new DialogInterface.OnClickListener() {@Overridepublic void onClick(DialogInterface arg0, int arg1) {}}).setNegativeButton(getString(R.string.disagree),new DialogInterface.OnClickListener() {@Overridepublic void onClick(DialogInterface arg0, int arg1) {}}).show();mProtocolDialog.setOnKeyListener(new OnKeyListener() {@Overridepublic boolean onKey(DialogInterface arg0, int keyCode, KeyEvent arg2) {if (keyCode == KeyEvent.KEYCODE_SEARCH) {}return false;}});}
- 弹出对话框
- 弹出对话框
- 弹出对话框
- 弹出对话框
- 弹出对话框
- 弹出对话框
- 弹出对话框
- 弹出对话框
- 弹出对话框
- 弹出对话框
- 弹出对话框
- 弹出对话框
- 弹出对话框
- 弹出对话框
- 弹出对话框
- 弹出对话框
- 弹出对话框
- 弹出对话框
- Linux命令整理(二)
- 关于JAVA核心技术的泛型一章
- Android开发中StackOverflowError错误实例分析
- 使用cxf开发webservice
- vi的命令
- 弹出对话框
- 在红帽的linux-rhce-5.4下配置lamp环境
- Android内存之VSS/RSS/PSS/USS
- 并查集
- 2011.12月初 背包问题专辑POJ 3624 1276 2392 1837
- PAL制与NTSC制的介绍
- 第一次用真机做测试
- vi 使用大全
- Java EE Application Model