Android 弹出输入框

final EditText inputServer = new EditText(SettingActivity.this);
                AlertDialog.Builder builder = new AlertDialog.Builder(SettingActivity.this);
                builder.setTitle("输入密码").setIcon(android.R.drawable.ic_dialog_info).setView(inputServer)
                        .setNegativeButton("取消", new DialogInterface.OnClickListener() {
                            @Override
                            public void onClick(DialogInterface dialog, int which) {
                                dialog.dismiss();
                            }
                        });
                builder.setPositiveButton("确定", new DialogInterface.OnClickListener() {
                    public void onClick(DialogInterface dialog, int which) {
                        String text = inputServer.getText().toString();
                   
                });
                builder.show();
            }
        });

android 弹出输入框,获取输入框值,带确定 取消 按钮

posted @ 2018-08-28 11:04  _York  阅读(8649)  评论(0编辑  收藏