android AlertDialog中的Edittext自动获取焦点并弹出软键盘
来源:互联网 发布:霍金人工智能开场白 编辑:程序博客网 时间:2024/05/16 06:19
转自 http://www.cuiweiyou.com/671.html
private void confirmPhoneGurdPswd(final String guardPswd) { // 1.创建弹出式对话框 final AlertDialog.Builder alertDialog = new android.app.AlertDialog.Builder(HomeActivity.this); // 系统默认Dialog没有输入框 // 获取自定义的布局 View alertDialogView = View.inflate(HomeActivity.this, R.layout.自定义布局, null); // 2.密码框-EditText。alertDialogView.findViewById(R.id.自定义布局中的文本框) final EditText et_dialog_confirmphoneguardpswd = (EditText) alertDialogView.findViewById(R.id.et_dialog_confirmphoneguardpswd); // 确认按钮,确认验证密码 Button btn_dialog_resolve_confirmphoneguardpswd = (Button) alertDialogView.findViewById(R.id.btn_dialog_resolve_confirmphoneguardpswd); btn_dialog_resolve_confirmphoneguardpswd.setOnClickListener(new OnClickListener() { // 点击按钮处理 public void onClick(View v) { // 提取文本框中输入的文本密码 } }); // 取消按钮,不验证密码 Button btn_dialog_cancel_confirmphoneguardpswd = (Button) alertDialogView.findViewById(R.id.btn_dialog_cancel_confirmphoneguardpswd); btn_dialog_cancel_confirmphoneguardpswd.setOnClickListener(new OnClickListener() { // 点击按钮处理 public void onClick(View v) { // } }); AlertDialog tempDialog = alertDialog.create(); tempDialog.setView(alertDialogView, 0, 0, 0, 0); /** 3.自动弹出软键盘 **/ tempDialog.setOnShowListener(new OnShowListener() { public void onShow(DialogInterface dialog) { InputMethodManager imm = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE); imm.showSoftInput(et_dialog_confirmphoneguardpswd, InputMethodManager.SHOW_IMPLICIT); } }); tempDialog.show(); }
0 0
- android AlertDialog中的Edittext自动获取焦点并弹出软键盘
- android EditText 自动获取焦点并弹出软键盘
- Android Dialog 中的EditText自动获取焦点弹出软键盘
- 安卓(Android)在AlertDialog中的EditText获取焦点并弹出、隐藏软键盘(输入法软件)
- android 自动弹出软键盘,EditText自动获取焦点
- EditText获取焦点并弹出软键盘
- edittext获取焦点并弹出软键盘
- Android EditText获取焦点并弹出软键盘
- Android 设置Edittext获取焦点并弹出软键盘
- Android EditText获取焦点并弹出软键盘
- EditText密码输入错误后重新获取焦点并自动弹出软键盘
- popupwindow中EditText获取焦点后自动弹出软键盘
- popupwindow中EditText获取焦点后自动弹出软键盘
- popupwindow中EditText获取焦点后自动弹出软键盘
- 控制EditText自动获取焦点弹出软键盘
- popupwindow中EditText获取焦点后自动弹出软键盘
- popupwindow中EditText获取焦点后自动弹出软键盘
- 禁止 EditText 自动获取焦点 弹出软键盘
- hadoop集群算PI值出现current time is .... found ....
- 拟物与扁平,不得不吐槽的对立(1)
- Win7 x64下支持16位Debug的Dos环境配置
- iOS10 调用相册崩溃等问题解决
- Web小应用
- android AlertDialog中的Edittext自动获取焦点并弹出软键盘
- 程序员智力题
- Python魔法(1)
- [数据结构与算法]队列的优先级
- CryptCreateHash + CALG_MD5
- eclipse的JNI学习
- Delphi 编写IC控件
- Open the file under the specified path, unlimited file name
- uCOS时钟节拍和滴答定时器的关系